Questions tagged [docker]

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

Docker is an open-source software container platform written in Go.

Resources

1184 questions
147
votes
5 answers

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 needs to have all processes to work? blog posts…
Evgeny Zislis
  • 9,023
  • 5
  • 39
  • 72
87
votes
10 answers

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) have the Docker client software installed. I would…
igal
  • 1,590
  • 1
  • 11
  • 15
50
votes
2 answers

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, customer information, etc.), that are used by…
Preston Martin
  • 3,288
  • 4
  • 18
  • 39
48
votes
7 answers

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. The other organization can't afford it by a…
Ta Mu
  • 6,792
  • 5
  • 43
  • 83
45
votes
3 answers

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-SHELL?
Zulhilmi Zainudin
  • 551
  • 1
  • 4
  • 4
37
votes
4 answers

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":"http://db:5984"}' When trying to run…
Tri Nguyen
  • 471
  • 1
  • 4
  • 5
35
votes
4 answers

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: . dockerfile: ./my-dockerfolder/Dockerfile …
bnieland
  • 465
  • 1
  • 4
  • 6
34
votes
2 answers

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 "outside" interface, that can access all host IP…
Hexaholic
  • 611
  • 1
  • 5
  • 8
34
votes
5 answers

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 healthcheck command locally does return a value. > curl…
ConorSheehan1
  • 515
  • 1
  • 7
  • 10
33
votes
3 answers

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-devel libxslt-devel python-devel openldap-devel…
alecxe
  • 849
  • 1
  • 16
  • 36
32
votes
2 answers

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 Jérôme's GitHub Repository receiving over a…
Richard Slater
  • 11,747
  • 7
  • 43
  • 82
32
votes
2 answers

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 it: $ docker build -t vol-test . Sending build…
kenorb
  • 8,011
  • 14
  • 43
  • 80
30
votes
4 answers

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 php (mounting the same path and enclosing both…
CarlosAS
  • 435
  • 1
  • 5
  • 9
29
votes
2 answers

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 we have separate logforwarders that send them…
SztupY
  • 1,597
  • 1
  • 16
  • 18
28
votes
2 answers

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 users? Because I don't know of a functional reason…
Alexander Bird
  • 395
  • 1
  • 3
  • 6
1
2 3
78 79