Skip to content

Instantly share code, notes, and snippets.

@jeffbryner
Created December 18, 2016 23:02
Show Gist options
  • Save jeffbryner/afa9c468a571533d66cf5e907c4d1e71 to your computer and use it in GitHub Desktop.
Save jeffbryner/afa9c468a571533d66cf5e907c4d1e71 to your computer and use it in GitHub Desktop.
create docker image of a meteor UI (mozdef)
#build mozdefUI
#rm all previous docker containers/images
docker ps -a
<list>
docker rm <imageid>
docker images
<list>
docker rmi $(docker images -qf "dangling=true")
#bundle existing mozdef UI project:
<cd to dir where you developed meteor UI>
meteor build --architecture=os.linux.x86_64 ./
cp <dirname.tar.gz> <dockerdir where you house the Dockerfile to build an image>
#build by unpacking bundle and installing all npm modules
docker build --tag mozdefui/base --label mozdefui --build-arg INSTALL_NPM=1 .
#save docker image:
docker save mozdefui/base | gzip > ../mozdefuibase.tar.gz
#scp to qa:
scp ../mozdefuibase.tar.gz mozdefqa1.private.scl3.mozilla.com:
#import on qa1:
mv ~/mozdefuibase.tar.gz /home/jbryner/envs/dockercontainers
gunzip -c mozdefuibase.tar.gz| docker load
#debug run on qa1 talking to local mongo on 127.0.0.1:
docker run -d --net=host -p 3000:3000 -e PORT=3000 -e MONGO_URL=mongodb://127.0.0.1:3002/meteor -it --entrypoint /bin/bash mozdefui/base
docker attach <containerID>
node bundle/main.js
#prod run on qa1 <no attach>
docker run -d --net=host -p 3000:3000 -e PORT=3000 -e MONGO_URL=mongodb://127.0.0.1:3002/meteor mozdefui/base node bundle/main.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment