docker on davidchua https://dchua.com/tags/docker/ Recent content in docker on davidchua Hugo -- gohugo.io en-us Fri, 17 Jun 2016 15:24:00 +0800 Painless ECR authentication for Docker https://dchua.com/posts/2016-06-17-painless-ecr-authentication-for-docker/ Fri, 17 Jun 2016 15:24:00 +0800 https://dchua.com/posts/2016-06-17-painless-ecr-authentication-for-docker/ I’ve been playing around with Jenkins lately and one of the problems I’ve been facing is that it gets tedious manually doing a aws ecr get-login every 12 hours on the Jenkins instances so that my builds can push docker images into ECR. You may be thinking, why not just add the authentication into the build step before the push. Tried that but for some reason, I’m never able to get it to eval correctly. Speed up NPM install in Docker Containers https://dchua.com/posts/2016-06-17-speed-up-npm-install-in-docker-containers/ Fri, 17 Jun 2016 00:00:00 +0000 https://dchua.com/posts/2016-06-17-speed-up-npm-install-in-docker-containers/ NPM installs in your docker containers getting slow, make sure you set registry! # Dockerfile RUN npm config set registry http://registry.npmjs.org/ && npm install --no-optional --verbose Try this the next time your NPM install feel like its taking forever. Getting Started with Jenkins using Docker https://dchua.com/posts/2016-06-10-getting-started-with-jenkins-using-docker/ Fri, 10 Jun 2016 00:00:00 +0000 https://dchua.com/posts/2016-06-10-getting-started-with-jenkins-using-docker/ $ docker run --user root --privileged -p 8080:8080 -p 50000:50000 -v /path/to/host/volume:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins Lets break it down. -p 8080:8080 What we’re doing here is to expose the Jenkins port on the container out to the host. Jenkins uses 8080 by default so you may want to change the host port to a port that you find comfortable. -p 50000:50000 Jenkins uses port 50000 for its REST API. Expose this too. Getting npm packages to be installed with docker-compose https://dchua.com/posts/2016-02-07-getting-npm-packages-to-be-installed-with-docker-compose/ Sun, 07 Feb 2016 00:00:00 +0000 https://dchua.com/posts/2016-02-07-getting-npm-packages-to-be-installed-with-docker-compose/ If you’re trying to deploy your node app into a docker container and you’re also using docker-compose, here’s something to watch out for. If you are running npm install on your Dockerfile, you might want to make sure that you mount /node_modules as a data volume in your docker-compose. For eg. your Dockerfile might look something like this: # Dockerfile FROM node:5.5.0 ADD ./ /node_app WORKDIR /node_app RUN npm install Normal stuff.