Questions tagged [docker]

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

Filter by
Sorted by
Tagged with
133
votes
5answers
56k 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 ...
58
votes
7answers
88k 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) ...
46
votes
7answers
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....
38
votes
2answers
34k 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 ...
32
votes
3answers
7k 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-...
30
votes
3answers
55k 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":"...
28
votes
4answers
11k 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 ...
27
votes
2answers
11k 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 ...
27
votes
2answers
4k 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 ...
24
votes
7answers
3k 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 ...
24
votes
2answers
12k 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 ...
22
votes
2answers
46k views

How to change the owner of VOLUME directory in Dockerfile?

I've got the following Dockerfile: FROM ubuntu:xenial RUN useradd -d /home/ubuntu -ms /bin/bash -g root -G sudo -p ubuntu ubuntu WORKDIR /home/ubuntu USER ubuntu VOLUME /opt/myvolume Which I built ...
22
votes
2answers
13k 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 "...
21
votes
6answers
10k 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 ...
20
votes
2answers
16k 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'...
20
votes
2answers
5k 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 ...
18
votes
3answers
23k 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 ...
18
votes
4answers
3k 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 ...
18
votes
1answer
9k views

How do I use docker command's "--format" option?

I can't seem to find any good documentation on how to use the docker command's "--format" option in real life. I know how to use Go templates. But specific to docker, how do I know what placeholders ...
17
votes
4answers
2k 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, ...
15
votes
3answers
14k views

One Jenkinsfile or multiple?

So I have a Jenkinsfile defining a build pipeline and then a Jenkins job (not pipeline) with a very simple deployment script for our Docker stacks. Seeing that Jenkinsfiles can become as complex and ...
15
votes
2answers
8k views

How to deal with docker compose's naming convention of named volumes?

When defining named volumes in docker-compose.yml, their names are prepended with their parent folder name. This causes a problem when scripts outside of docker compose have to interact with them. The ...
15
votes
3answers
12k views

Is there any concrete and acceptable solution for running systemd inside the docker container?

I have seen many workarounds for this to run systemd inside docker containers but looks like most of them compromise the security of the container and the host. How are most people here dealing with ...
14
votes
3answers
34k views

How can I force Docker Compose to rebuild containers when dockerfile changes?

I am using docker-compose to start 2 containers using the following docker-compose.yaml. version: '2.4' services: myservice1: container_name: mycontainername build: context: . ...
14
votes
1answer
10k 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 ...
14
votes
3answers
19k 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 { ...
14
votes
3answers
7k 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 ...
14
votes
3answers
10k 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 ...
14
votes
6answers
396 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 ...
14
votes
3answers
7k 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 ...
14
votes
2answers
22k 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. ...
13
votes
7answers
2k 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 ...
13
votes
2answers
9k 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 ...
13
votes
2answers
2k views

How to investigate a main process that has died in a docker container?

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, ...
13
votes
5answers
4k 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'...
13
votes
2answers
1k 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 ...
13
votes
2answers
552 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 ...
13
votes
2answers
736 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? ...
12
votes
2answers
2k 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 ...
12
votes
2answers
14k views

Gitlab CI error during connect: Get http://docker:2375/v1.40/containers/json?all=1: dial tcp: lookup docker on xx.xx.xx.x:xx: no such host

I've recently created a new repository in gitlab.com, started a new Ubuntu instance in digitalocean, installed docker and gitlab-runner in the ubuntu instance. Also, did gitlab-runner register and ...
11
votes
4answers
3k 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, ...
11
votes
7answers
2k views

Is there one website that contains all relevant DevOps news and gets updated on a daily basis?

I am looking for some DevOps news channel like https://nos.nl/teletekst#101 that shows the headlines of the Dutch news. I am aware of https://tweakers.net/ and github.com, but this does not contain ...
11
votes
2answers
8k 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
16k views

How to configure Docker tooling on Eclipse?

The Eclipse plugin "Docker tooling" seems to expect the installation of Docker Machine, or a network connection. But, on Windows 10 things seem different from what this plugin expects so I can't ...
10
votes
1answer
14k views

Internal network between container Docker Compose with outgoing connection

I am a newbie to Docker. I am trying to run my application containing from multiple containers Here is my docker-compose.yml file version: '3.3' services: php-service: container_name: 'php-...
10
votes
3answers
2k 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 ...
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
1answer
217 views

How to know where a docker image came 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 ...
9
votes
1answer
1k 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
7k views

How to explicitly kill the process with PID 1 from inside a container?

For demonstration purposes, I would like to kill the process with PID 1 from inside a container. But apparently, kill 1 doesn't work: $ sudo docker run -it centos [root@3752d3a44f10 /]# ps PID TTY ...

1
2 3 4 5
19