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

docker-machineで簡単にデモ環境を構築する、あるいはローカルのリソースを消費し...

docker-machineで簡単にデモ環境を構築する、あるいはローカルのリソースを消費しない開発環境について / Easily build an environment with docker-machine

yuki-yano

July 02, 2019
Tweet

More Decks by yuki-yano

Other Decks in Programming

Transcript

  1. Output • Dockerͷجຊʹ͍ͭͯपล؀ڥ·Ͱ·ͱΊ
 https://qiita.com/yuki_ycino/items/b94ae2bf7d78685cd6f5 • Electron + Vue + flowtypeͰ࠷ߴͷը૾Λऩू͢ΔͨΊͷ

    TwitterΫϥΠΞϯτΛ࡞ͬͨ
 https://qiita.com/yuki_ycino/items/9a2f7feef947c4c258ac • tmuxΛޮ཰Α͘࢖ͬͯ։ൃΛര଎ʹ͢Δ࠷ߴͷઃఆ
 https://qiita.com/yuki_ycino/items/ef5e6b63c8f9af2f03c0
  2. ͜Μͳײ͡ $ docker-machine create --driver amazonec2 --amazonec2-access-key XXXXXXXX --amazonec2-secret-key XXXXXXXX

    --amazonec2-ami ami-06c43a7df16e8213c --amazonec2-instance-type t3.large --amazonec2- region ap-northeast-1 --amazonec2-vpc-id vpc-xxxxxxxx --amazonec2- subnet-id subnet-xxxxxxxx --amazonec2-zone a docker-machine-test $ eval $(docker-machine env docker-machine-test) $ export COMPOSE_FILE=docker-compose-aws.yml $ docker-compose build $ docker-compose up $ docker-machine ssh docker-machine-test -L 3000:localhost:3000 $ docker-machine rm docker-machine-test
  3. େମ͍͚Δ • ϩʔΧϧͷϑΝΠϧΛ؂ࢹ͠ͳ͕Βrsync • ։ൃαʔόΛϙʔτϑΥϫʔσΟϯά • /home/ubuntu/appΛvolume େମग़དྷͨ $ fswatch

    ./ | while read file; do rsync -avzhe 'docker-machine ssh docker-machine-dev' --exclude='node_modules' --progress ./ : ; done $ docker-machine ssh docker-machine-dev -L 3000:localhost:3000