Questions tagged [docker]

Docker images, containers, hub, and everything related to the containerization platform

64
votes
5answers
26k views

Why it is recommended to run only one process in a container?

In many blog posts, and general opinion, there is a saying that goes "one process per container". Why does this rule exist? Why not run ntp, nginx, uwsgi and more processes in a single container that ...
39
votes
6answers
3k views

What are best and comprehensive practices to consider when running docker in production?

Finally, you are so much in love with Docker that you want to move your online business-critical production systems with sensitive customer data to a Docker Swarm. Some might even already have done so....
26
votes
3answers
6k views

Understanding Docker layers

We have the following block in our Dockerfile: RUN yum -y update RUN yum -y install epel-release RUN yum -y groupinstall "Development Tools" RUN yum -y install python-pip git mysql-devel libxml2-...
26
votes
5answers
24k views

Downloading Docker Images from Docker Hub without using Docker

I want to manually download a Docker Image from Docker Hub. More specifically, I want to download a Docker Image from Docker Hub on a machine in a restricted environment which does not (and cannot) ...
21
votes
2answers
7k views

Passing secrets to a Docker container

I have a base docker image which is used to run image analysis software. For each container created from the image, there are a set of configuration settings some of which are secrets (encryption keys,...
21
votes
1answer
2k views

Why is Docker-in-Docker considered bad?

In August 2013 Jérôme Petazzoni created Docker in Docker, dind for short, this allowed Docker containers to be created inside of Docker Containers, this functionality proved very popular resulting in ...
20
votes
2answers
5k views

Why use EXPOSE in Dockerfile — since you can bind to all ports anyways

I can docker run -p 3000:3000 image without EXPOSEing that port in the container (see below). If that's true, then why bother putting EXPOSE in the Dockerfile? Is it just for communication to image ...
18
votes
6answers
768 views

How to create the smallest working docker image every time?

Aim: to create the smallest working docker images every time Current REPOSITORY TAG IMAGE ID CREATED SIZE a-docker-image latest x 42 ...
18
votes
4answers
6k views

What are the advantages of dockerizing nginx and php in different containers?

I just started working with Docker and Kubernetes and I've been watching a lot of stacks, in which some people build nginx+php in a single image and some build an image with nginx and another one with ...
18
votes
2answers
5k views

How to have multiple log streams in docker

We have an application that writes three types of logs into three separate files: access logs, generic application logs and system logs. The format (and purpose) of these logs are very different. And ...
16
votes
2answers
14k views

docker-compose invalid type, it should be a string

I have the following environment variable configured in a docker-compose.yml file: version: '3' services: server: ports: - 13045:3000 environment: - NODE_CONFIG: '{"DATABASE_URL":"...
15
votes
2answers
3k views

Where should I put my application configuration?

I've been reading lately a debate about "Where should properties that depend on the environment be stored?". The classical way is to have multiple property files, one by environment, and based on an ...
14
votes
6answers
348 views

Is Docker right for my use case?

My company has a system we sell that consists of basically a mini-computer "Smartbox" that is running Ubuntu 12.04. This box runs a Django application plus a number of different upstart processes ...
13
votes
3answers
12k views

Is there no Oracle JDK for docker?

REPOSITORY TAG IMAGE ID CREATED SIZE an-image 1 X 26 seconds ago 279 MB when the docker image will be run, the following message ...
13
votes
5answers
2k views

How to prohibit access to internals of Docker container?

I want to deliver my app to customers in form of docker image. But it is crucial to ensure that end-user do not alter anything inside the container. User should only be able to run/stop the container ...
13
votes
4answers
1k views

Are there any drawbacks of using a deb package as if it was a container to deploy an application?

My team is currently trying to decide if we should deploy our Nodejs app as a deb package instead of trying to run it in a container such as Docker. I got this idea from reading this blog here which ...
12
votes
4answers
744 views

Are there any best practices and/or tools for cleaning old Docker images on a regular basis?

Is there an elegant way or a best practice when it comes to deleting old images from the Docker registry? I see a lot of requests/issues here: https://github.com/docker/docker-registry/labels/delete, ...
12
votes
2answers
730 views

Docker Container capacity planning

I'm running my application on 4 Virtual Machines with 8 3.2 GHz Virtual CPUs and 32 GB, however, I will be splitting up the processes into separate containers. I am not sure how many containers to ...
12
votes
2answers
411 views

Combine Docker Swarm and Kubernetes

My company is trying to play a little catch-up in the DevOps space. I have been doing a lot of research on containerization of applications and the orchestration systems that go with it. I came across ...
11
votes
7answers
819 views

Why should a developer care about Docker?

Generally a developer cares about satisfying business requirements. He / she might have the expertise in a particular stack or a framework. But should he / she make an effort to learn docker and it's ...
11
votes
2answers
4k views

What are the correct permission settings when running Docker in a Jenkins Pipeline?

I'm trying to get a new jenkins pipeline together to test new pull requests to our code. I'm using docker with the ubuntu:14.04 image to simulate our production environment. Here is a minimum working ...
11
votes
2answers
1k views

How to run experimental Docker features on CircleCI

When a build is started on CircleCI one of the first things that is done is: Setup a remote Docker engine Specified reusable docker engine, but build has not been whitelisted. Contact CircleCI to ...
11
votes
2answers
839 views

How should I best investigate a docker container where the main process has died?

Sometimes you have to investigate a container, which is stopped, or a container which after starting up dies very quickly and stops. docker exec -ti <id> bash only works on running containers, ...
11
votes
3answers
1k views

Cannot connect to chocolatey.org or any other internet site from within container

xpost from https://forums.docker.com/t/cannot-connect-to-chocolatey-org/38745 Expected behavior I'm running Windows Server 2016 Datacenter (MSDN download) 64 bit - Version 1607 - Build 14393.1715 I'...
11
votes
2answers
10k views

How to enable the npm cache in a Jenkins build slave that runs in docker?

I have a Docker image, let's call it frontend.image, that I use for a Jenkins build slave. The Jenkins Docker plugin will spin up a container from this image and build artifacts inside the container. ...
10
votes
4answers
1k views

How to structure DevOps related code and configs in a code repository?

We've been growing as a company, our products are expanding and our DevOps related activities and efforts are growing as well - we've switched from Bamboo to a more flexible and configurable Jenkins, ...
10
votes
3answers
7k views

Jenkins: Permission issue using Docker as build environment

I installed Jenkins on an Ubuntu 16.04 machine. The Jenkins itself is not run in a container. What I want to do is simply call yarn install using a node image. So here is my Jenkinsfile: pipeline { ...
10
votes
2answers
1k views

Why is environment variable mangled in docker compose environment file

Context: docker-compose to start several containers, including Gunicorn that calls a Flask app. I'm using an environment file web/env.gunicorn to store my Gunicorn startup configuration. This file ...
10
votes
1answer
4k views

Connect Docker container to both host and internal bridge network

I am trying to run a Docker container as a router between a private (--internal) Docker network and the predefined host network. This means the container needs to have two network interfaces: One "...
10
votes
3answers
507 views

How do I automate deployments with Kubernetes?

Assuming I have Kubernetes deployed via Rancher and Jenkins is building new images and pushing them to DockerHub upon check-in of new code to GitHub, how do I automate getting new images deployed? ...
9
votes
1answer
2k views

Does “docker run” actually SSH into the container?

If I run docker run -it ubuntu bash Does it actually SSH into the container, or does it use another protocol?
9
votes
3answers
2k views

What are best practices for docker tag versioning?

I've recently hooked our CI servers up to build docker images upon git commit. We have about 8 different containers that get built, each with their own language / frameworks. Some are node and have ...
9
votes
1answer
836 views

Conflicting Kubernetes CPU usage & Docker Container Metrics

We recently switched over our production environment to Kubernetes. I'd like to enforce CPU limits on the containers. I'm getting conflicting CPU metrics that do not fit together. Here's my setup: ...
8
votes
2answers
3k views

Why not use configuration management tool instead of Dockerfile?

I'm pretty new to Docker and configuration management tools. At first I started writing bash scripts to provision my Vagrant boxes for my development machines, but now I've switched to using Chef ...
8
votes
2answers
2k views

On Azure, how do I run a short-lived Docker container on a schedule?

I have a fairly simple Unix shell script packaged up in an Alpine Linux Docker container hosted on an Azure container registry. A VM runs this script with cron: docker login <snip> docker pull ...
8
votes
2answers
6k views

Difference between chroot and Docker

I don't understand the difference between docker and chroot. Yes its nice in terms of the packaging the registry. But somehow I get the feeling its just chroot with extra bells and whistles. I know I'...
8
votes
1answer
291 views

How do I automate deployment to Docker with CircleCI?

My circle.yml file and my CircleCI account are set up to use Docker for testing already, but I'd like to move to continuous deployment upon a successful build. Here's what I have so far in circle.yml:...
8
votes
1answer
412 views

Persistent Storage with Docker in Production - Which Solution and Why?

I've recently started working for a company that wants to break their monolithic SaaS application up into containerized microservices. I'm having a hard time grasping a fundamental part of persistent ...
8
votes
1answer
70 views

How to know where a docker image come from?

I have a docker image on my system 12346789ABCD. Is there a way to know where it is coming from? Specifically, I would like to know if it was built locally or downloaded from a repository, and in ...
8
votes
2answers
647 views

Encrypting docker images (end to end); transporting over offline channels

We are developing and building docker images in our intranet, and need to deploy them to several hosts belonging to us (developers, internal testing, external testing and so on). Some of these are in ...
7
votes
3answers
143 views

How to evangelize DevOps and tools in a low acceptance environment?

An evocative learning about innovative disruptive technology is that you might find out that not everybody is going to be excited about tools which can give you more productivity. To make this ...
7
votes
2answers
2k views

Does Docker allow containers to be OS agnostic?

We currently use a Windows based server to host 2 VMs. One VM uses Windows with a Windows app and the other VM uses Linux with a Linux app. Is the below scenario possible? Bare server with Windows ...
7
votes
2answers
815 views

How do you monitor Node Micro services running inside of Docker Containers?

This article about "How healthy is your Dockerized application?" explains the trouble with monitoring, but it doesn't provide any good examples of how to actually monitor a microservice inside of the ...
7
votes
3answers
229 views

How to deploy multiple dependent micro services

We want to deploy multiple microservices on AWS ECS. The issue that we need to solve is how to deploy them in an atomic way: Let says we have the front-end services which requires the user service ...
7
votes
6answers
564 views

Cheapest and easiest way to run a periodic Docker process

I have a dockerized Python process that a client would like to run once or twice a month. It calls a number of Google APIs and stores the results in a Google Sheet. It does not accept network requests....
7
votes
1answer
3k views

Dockerized Flask: Connection reset by peer

Trying to connect to a dockerized Flask app fails with error 104, 'Connection reset by peer' using this minimal example: app.py: from flask import Flask app = Flask(__name__) @app.route("/") def ...
7
votes
2answers
519 views

How to cache third party resources in a build pipeline?

A build-pipeline often requires to access third party resources, aside from the source code of the artefacts it is meant to build. Each of these third party resources introduce a risk factor in builds,...
7
votes
1answer
460 views

Continuous deployment Angular, PHP Api and Ansible - multisite

I am working on an Angular2 project with Yii2 (PHP/MySQL) as its API point. We will need to deploy the Angular app in different languages for different customers (using AOT compilation from angular-...
7
votes
1answer
361 views

Should worker processes of web applications be placed in separate containers?

My setup is based on a Flask app that has a PostgreSQL and Redis database. In addition, a worker process is started to handle asynchronous tasks such as sending emails. I use Gunicorn to create ...
7
votes
2answers
3k views

Why are unnamed volumes created when `docker-compose up` is run and do these double after issuing `docker-compose down && docker-compose up`?

When starting a docker compose application, it creates named volume the first time around and then additional volumes each time it is started. Is this the normal behavior in that it creates ...