Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AngularJSを通してDockerと触れ合った

 AngularJSを通してDockerと触れ合った

Angular meetup #3の資料です

Kenichiro Okada

November 22, 2015
Tweet

More Decks by Kenichiro Okada

Other Decks in Technology

Transcript

  1. ίϯςφͷىಈ • docker run <Φϓγϣϯ> <Πϝʔδ໊:λά> <ίϚϯυ> <Ҿ਺> • -i

    ͸ίϯςφͰͷඪ४ೖྗΛՄೳʹ͢Δ • -t ͸ٖࣅλʔϛφϧΛల։͢Δ $ docker run -i -t node bash root@d7d20a8e7bb7:/# node -v v5.0.0 root@d7d20a8e7bb7:/# npm -v 3.3.6
  2. ίϯςφͷىಈ • docker run <Φϓγϣϯ> <Πϝʔδ໊:λά> <ίϚϯυ> <Ҿ਺> • -v

    ͸ϗετͷσΟϨΫτϦΛίϯςφʹϚ΢ϯτ͢Δ • -p ͸ϙʔτϑΥΞϦϯά͢Δ $ docker run -v `pwd`:/tmp -p 8080:8080 node ls -l total 60 drwxr-xr-x 2 root root 4096 Nov 10 00:43 bin drwxr-xr-x 2 root root 4096 Aug 26 16:31 boot drwxr-xr-x 5 root root 360 Nov 22 02:58 dev drwxr-xr-x 61 root root 4096 Nov 22 02:58 etc drwxr-xr-x 2 root root 4096 Aug 26 16:31 home drwxr-xr-x 12 root root 4096 Nov 10 00:43 lib
  3. ίϯςφͷఀࢭ • Ctrl + P + QͰίϯςφΛఀࢭͤͣʹ
 ݩͷλʔϛφϧʹ໭Δʢσλονʣ • ࠶౓Ξλον

    root@d7d20a8e7bb7:/# exit $ $ docker attach d7d20a8e7bb7 root@d7d20a8e7bb7:/#
  4. • ίϯςφΛىಈͯ͠ΞϓϦΛ࣮ߦ $ cd material-start $ docker run -it -v

    `pwd`:/tmp -p 8080:8080 node:0.12.5 bash root@d7d20a8e7bb7:/# node -v v0.12.5 root@d7d20a8e7bb7:/# npm -v 2.11.3 root@d7d20a8e7bb7:/# cd /tmp root@d7d20a8e7bb7:/tmp# npm start
  5. FROM node:0.12.7 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app ONBUILD COPY

    package.json /usr/src/app/ ONBUILD RUN npm install ONBUILD COPY . /usr/src/app CMD [ "npm", "start" ]
  6. Πϝʔδදࣔ • docker images <Φϓγϣϯ> $ docker images REPOSITORY TAG

    IMAGE ID CREATED VIRTUAL SIZE pastelinc/material-start latest 820019b78a27 15 minutes ago 1.042 GB
  7. • DockerfileΛ࢖ͬͯΠϝʔδΛ࡞੒ • Πϝʔδ͔ΒίϯςφΛىಈ $ docker build -t pastelinc/material-start .

    $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE pastelinc/material-start latest 820019b78a27 15 minutes ago 1.042 GB $ docker run -d -p 3000:8080 pastelinc/material-start