Database migrations in docker swarm mode

I have an application that consists of simple Node app and Mongo db. I wonder, how could I run database migrations in docker swarm mode? Without swarm mode I run migrations by stopping first the old version of application, running one-off migration command with new version of application and then finally starting a new version […]

Docker: npm install behind proxy

I have this Dockerfile: FROM node:argon ENV http_proxy http://user:pass@proxy.company.priv:3128 ENV https_proxy https://user:pass@proxy.company.priv:3128 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ RUN npm install # Bundle app source COPY . /usr/src/app EXPOSE 8080 CMD [ “npm”, “start” ] But I get this error, in npm install step: npm info it worked […]

Amazon S3 + Docker – “403 Forbidden: The difference between the request time and the current time is too large”

I am trying to run my django application in a docker container with static files served from Amazon S3. When I run RUN $(which python3.4) /home/docker/code/vitru/manage.py collectstatic –noinput in my Dockerfile, I get a 403 Forbidden error from Amazon S3 with the following response XML <?xml version=”1.0″ encoding=”UTF-8″?> <Error> <Code>RequestTimeTooSkewed</Code> <Message>The difference between the request […]

How do you manage permissions when developing in a Docker container?

When developing in a Docker container on Linux, there is a problem with permissions: how to manage file ownership and permissions between the host and the container. Imagine that I have a Docker image that runs Ubuntu and an Apache server. Using the default settings for (recent versions of) Apache, the document root will be […]

Cannot push to remote repo using the (spotify) Docker maven plugin

I’ve got a Spring Boot project which I want to built an image from and push to a Docker private registry. I’ve followed Spring Boot official docs for that, using the Spotify Docker Maven plugin. That worked well when publishing my image to a docker local instance using Boot2Docker. Now I’m trying to do the […]

docker-compose up fails with “ Unable to find a node that satisfies the following conditions ”

My docker-compose.yml is: version: ‘2’ services: db: build: ./postgres ports: – “5432:5432” volumes: – postgres-data:/data env_file: .env environment: – “constraint:node=edge” networks: – back-tier volumes: postgres-data: driver: local networks: back-tier: driver: overlay And I have two nodes in a docker swarm in google. I created them with the following: ## Swarm master docker-machine –debug create –driver […]

Docker – remove all but last N images

I am trying to build a small script that removes all docker images besides a small “cache” of N last images (for rolling back to one of the last working versions). Is there an idiomatic way to do this?

Creating a Docker Image for a Github Project

I have a GitHub project, (that I am working with (I didn’t create it)), called OpenRefine, which I would like to encapsulate in a Docker image, such that other people can then pull that Docker image from the “Docker Hub” and have OpenRefine installed on their fundamental interactive Docker entity, viz. Image. I want to […]

Pass a variable to a Dockerfile from a docker-compose.yml file

I have several docker-compose.yml files that I want to use the same Dockerfile with, with a slight variation. So I want to pass an argument to that Dockerfile so that I can do something slightly different depending on whatever value the variable is set to. What I have tried so far docker-compose-A.yml file version: ‘2’ […]

nginx docker container: 502 bad gateway response

I’ve a service listening to 8080 port. This one is not a container. Then, I’ve created a nginx container using oficial image: docker run –name nginx -d -v /root/nginx/conf:/etc/nginx/conf.d -p 443:443 -p 80:80 nginx After all: # netstat -tupln | grep 443 tcp6 0 0 :::443 :::* LISTEN 3482/docker-proxy # netstat -tupln | grep 80 […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.