Skip to main content

Questions tagged [docker]

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

Filter by
Sorted by
Tagged with
146 votes
5 answers
64k 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 ...
Evgeny Zislis's user avatar
82 votes
8 answers
165k 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) ...
igal's user avatar
  • 1,530
50 votes
2 answers
53k 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 ...
Preston Martin's user avatar
  • 3,278
48 votes
7 answers
4k 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....
Ta Mu's user avatar
  • 6,782
37 votes
4 answers
103k 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":"...
Tri Nguyen's user avatar
33 votes
3 answers
8k 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-...
alecxe's user avatar
  • 849
31 votes
4 answers
69k 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: . ...
bnieland's user avatar
  • 425
31 votes
2 answers
86k 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 ...
kenorb's user avatar
  • 7,901
31 votes
3 answers
20k views

Healthcheck: CMD vs CMD-SHELL

It's not clear to me what are the differences between CMD and CMD-SHELL in Docker Compose healthcheck. What are the benefits of using CMD-SHELL compared to CMD? What are the use cases for CMD and CMD-...
Zulhilmi Zainudin's user avatar
31 votes
2 answers
11k 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 ...
Richard Slater's user avatar
30 votes
4 answers
13k 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 ...
CarlosAS's user avatar
  • 435
30 votes
2 answers
30k 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 "...
Hexaholic's user avatar
  • 571
29 votes
5 answers
29k views

docker-compose healthcheck for rabbitMQ

I'm trying to run rabbitMQ using docker-compose, but the service is always starting or unhealthy. rabbit is running fine, so I suspect there is something wrong with my health check. Running the ...
ConorSheehan1's user avatar
28 votes
7 answers
4k 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 ...
030's user avatar
  • 13.2k
28 votes
2 answers
13k 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 ...
Alexander Bird's user avatar
28 votes
2 answers
15k 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 ...
SztupY's user avatar
  • 1,577
26 votes
6 answers
16k 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 ...
Victor Mezrin's user avatar
26 votes
3 answers
25k 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'...
Vipin Menon's user avatar
21 votes
1 answer
18k 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 ...
Todd Walton's user avatar
20 votes
3 answers
27k 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 ...
030's user avatar
  • 13.2k
20 votes
2 answers
7k 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 ...
carcaret's user avatar
  • 301
19 votes
4 answers
4k 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 ...
avi's user avatar
  • 1,279
18 votes
5 answers
12k 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 ...
Sijmen Mulder's user avatar
18 votes
3 answers
14k 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 ...
Moritz's user avatar
  • 1,217
17 votes
4 answers
23k 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 { ...
Michael's user avatar
  • 271
17 votes
4 answers
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, ...
Dawny33's user avatar
  • 2,816
17 votes
2 answers
17k 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 ...
Moritz's user avatar
  • 1,217
16 votes
1 answer
15k 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 ...
mcnesium's user avatar
  • 375
16 votes
3 answers
18k 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 ...
Worp's user avatar
  • 679
15 votes
6 answers
423 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 ...
Alberto Sancho's user avatar
15 votes
3 answers
9k 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 ...
Jack Murphy's user avatar
15 votes
3 answers
14k 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 ...
lakshayk's user avatar
  • 636
14 votes
7 answers
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 ...
Abhay Pai's user avatar
  • 303
14 votes
5 answers
5k 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'...
jcolebrand's user avatar
  • 1,275
14 votes
2 answers
11k 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 ...
nanonerd's user avatar
  • 241
14 votes
2 answers
629 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 ...
EvanM's user avatar
  • 248
14 votes
2 answers
29k 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. ...
Brian Ogden's user avatar
14 votes
2 answers
783 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? ...
Greg's user avatar
  • 141
13 votes
2 answers
4k 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, ...
SztupY's user avatar
  • 1,577
13 votes
2 answers
19k 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 ...
punkbit's user avatar
  • 349
13 votes
2 answers
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 ...
shrao's user avatar
  • 139
12 votes
2 answers
18k 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 ...
Sylvain Leroux's user avatar
12 votes
1 answer
21k views

What is the difference between php-cli and php-fpm, why 2 php variants and why choose one or the other?

Looking at https://hub.docker.com/_/php I can see reference to php-cli and php-fpm. Now, I am aware of the concepts of PHP FPM - Fast CGI Process Manager. I'm also aware the PHP can be run in the ...
therobyouknow's user avatar
12 votes
2 answers
7k views

What is the purpose of running PHP-FPM in its own container instead in the same container as apache2/nginx?

I'm fairly new to Docker so excuse any obvious ignorance or misunderstandings. That said, I've been coding and configuring web applications for a long time now. I have recently been dabbling with some ...
K8sN0v1c3's user avatar
  • 195
12 votes
7 answers
3k 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 ...
030's user avatar
  • 13.2k
12 votes
2 answers
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 ...
030's user avatar
  • 13.2k
12 votes
2 answers
24k 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 ...
Ta Mu's user avatar
  • 6,782
11 votes
4 answers
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, ...
alecxe's user avatar
  • 849
11 votes
2 answers
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 ...
tobassist's user avatar
  • 221
11 votes
1 answer
25k 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-...
solderingiron's user avatar

1
2 3 4 5
23