Questions tagged [docker]

For questions about building and running Docker containers. DOCKER QUESTIONS MUST BE SPECIFICALLY RELATED TO SOFTWARE DEVELOPMENT. Suitable topics include Dockerfiles, Docker Compose, and architecture. As a rule of thumb, if your question is about something happening inside the container, it's probably on-topic here; if it's outside the container, it is probably off-topic.

The term docker usually refers to a set of open-source tools that allow developers to build and run containers individually or as a 'stack' of related containers. A container is an isolated package that contains everything, except for the kernel, needed to run a piece of software. Docker was initially written to work with Linux and has recently been implemented on MS Windows. Docker Inc. is the company behind the open-source docker toolset.

Docker builds a high-level API over execution drivers, such as OpenVZ, systemd-nspawn, libvirt-lxc, libvirt, QEMU/KVM, BSD Jails, Solaris Zones, and chroot to run processes with some degree of isolation and repeatability across environments. The default execution driver since release 0.9 is Docker's own libcontainer driver. It's mainly written in Go, and its source code can be found on Github. See Docker's official website for details.

For a docker installation on different operating systems such as Linux, Windows, or OS X, details can be found here; from this site, information about Docker under Windows, Mac or Linux distributions can be accessed. On Windows and OS-X, docker runs in a variety of VM.

Releases have three types: stable, edge and test. The latest stable version is given by the following badge (links to the corresponding release notes): docker:latest version

Note that since May 2017, docker is a product (split into CE and EE) built on top of the open-source project Moby. In November 2019, Docker Inc. sold its enterprise business and software to Mirantis. For more, see "Demystifying the Relationship Between Moby & Docker".

Where to ask

Questions on Stack Overflow must be programming-related; see the extended description in the help centre for more details. Questions about using Docker as a live development environment, mechanics of the Dockerfile system, and other questions that clearly involve application source code are generally welcome.

Questions about installing Docker or running prebuilt images are typically not programming-oriented and are not on-topic for Stack Overflow. Consider asking these questions on Super User, or a site more specific to your host operating system (Ask Ubuntu, Unix & Linux, Raspberry Pi Stack Exchange, Ask Different for macOS). Questions about using a Linux distribution package manager such as apt-get or apk are similarly inappropriate for Stack Overflow, even if they are otherwise in the context of a Dockerfile.

There are other container-management tools adjacent to Docker. In particular, is often used in combination with images produced with Docker. The tag should be used when a question is principally about native-Docker technologies, including and the build system; but omit if a question is principally about a Kubernetes YAML file or another adjacent technology and only includes a Docker image by reference.

Frequently asked questions

Where to start

  • Docker Curriculum: A comprehensive tutorial for getting started with Docker. Teaches how to use Docker and deploy dockerized apps on AWS with Elastic Beanstalk and Elastic Container Service.
  • Docker Documentation: the official documentation
  • Docker Training :heavy_dollar_sign:
  • Katacoda: Learn Docker using Interactive Browser-Based Labs
  • Learn Docker: a step-by-step tutorial and more resources (video, articles, cheat sheets) by @dwyl
  • Play With Docker: PWD is a great way to get started with Docker for beginner to advanced users. Docker runs directly in your browser.
  • Play With Moby: PWM is a web-based Moby playground which allows you to try different components of the platform in seconds. It gives you the experience of having a free Alpine Linux Virtual Machine in the cloud where you can build and run Moby projects and even create clusters to experiment.
  • Practical Introduction to Container Terminology The landscape for container technologies is more significant than just docker. Without a good handle on the terminology, It can be challenging to grasp the key differences between docker and (pick your favourites, CRI-O, rkt, lxc/lxd) or understand what the Open Container Initiative is doing to standardize container technology.
  • Docker Tutorial for Beginners (Updated 2019 version) — In this Docker tutorial, you'll learn all the basics and learn how you can containerize Node.js and Go applications. Even if you aren't familiar with these languages, it should be easy for you to follow this tutorial and use any other language.

Books

Development with Docker

API Client

CI/CD

  • Buddy:heavy_dollar_sign: - The best of Git, build & deployment tools combined into one powerful tool that supercharged our development.
  • Captain - Convert your Git workflow to Docker containers ready for Continuous Delivery by @harbur.
  • Cyclone - Powerful workflow engine and end-to-end pipeline solutions implemented with native Kubernetes resources by @caicloud.
  • Docker plugin for Jenkins - The aim of the docker plugin is to be able to use a docker host to dynamically provision a slave, run a single build, and then tear down that slave.
  • Drone - Continuous integration server built on Docker and configured using YAML files.
  • GitLab Runner - GitLab has integrated CI to test, build and deploy your code with the use of GitLab runners.
  • GOCD-Docker - Go Server and Agent in docker containers to provision.
  • Microservices Continuous Deployment - Continuous deployment of a microservices application.
  • mu - Tool to configure CI/CD of your container applications via AWS CodePipeline, CodeBuild and ECS @Stelligent
  • Screwdriver :heavy_dollar_sign: - Yahoo's OpenSource build platform designed for Continous Delivery.
  • Skipper - Easily dockerize your Git repository by @Stratoscale
  • SwarmCI - Create a distributed, isolated task pipeline in your Docker Swarm.
  • Watchtower - Automatically update running Docker containers by [@CenturyLinkLabs][centurylinklabs]

More resources

Related tags

133164 questions
43
votes
4 answers

How do you perform a HEALTHCHECK in the Redis Docker image?

Recently, we had an outage due to Redis being unable to write to a file system (not sure why it's Amazon EFS) anyway I noted that there was no actual HEALTHCHECK set up for the Docker service to make sure it is running correctly, Redis is up so I…
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
43
votes
2 answers

Is there a way to clean docker build cache?

I am running a lot of builds using Docker in MacOS. Eventually, a lot of build cache is accumulating, e.g. this is what I see in docker system df: YPE TOTAL ACTIVE SIZE RECLAIMABLE Images 22 0 9.67GB …
StasM
  • 10,593
  • 6
  • 56
  • 103
43
votes
2 answers

Docker image layer: What does `ADD file: in /` mean?

In Docker Hub images there are lists of commands that being run for each image layer. Here is a golang example. Some applications also provide their Dockerfile in GitHub. Here is a golang example. According to the Docker Hub image layer, ADD…
43
votes
7 answers

Installing docker-compose on Amazon EC2 Linux 2. 9kb docker-compose file

First of all, let me state I'm not the most virtuous of Linux users, so bear with me... Below is a brief run-down of all the steps I took. Ultimately the question/issue is is that it seems impossible for me to get a proper docker-compose…
43
votes
1 answer

Benefits of repeated apt cache cleans

In the quest for ever smaller Docker images, it's common to remove the apt (for Debian/Ubuntu based images) cache after installing packages. Something like RUN rm -rf /var/lib/apt/lists/* I've seen a few Dockerfiles where this is done after each…
jmd_dk
  • 12,125
  • 9
  • 63
  • 94
43
votes
8 answers

Docker fails to pull the image from within Azure App Service

The Container Setting on the App Service it self look solid: But the log pane shows errors: 2020-02-11 06:31:40.621 ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository) 2020-02-11 06:31:41.240…
mark
  • 59,016
  • 79
  • 296
  • 580
43
votes
5 answers

ERROR: Pool overlaps with other one on this address space when starting my_project docker setup

I'm trying to setup docker and I`m getting the following error: ERROR: Pool overlaps with other one on this address space What should I do to solve it,please?
bruna_dosti
  • 439
  • 1
  • 4
  • 5
43
votes
3 answers

docker volume type - bind vs volume

TLDR In docker-compose, what's the difference between volumes: - type: volume source: mydata target: /data and volumes: - type: bind source: mydata target: /data ? The question in long: When you specify the volumes…
Efrat Levitan
  • 5,181
  • 2
  • 19
  • 40
43
votes
3 answers

What is "/app" working directory for a Dockerfile?

In the docker docs getting started tutorial part 2, it has one make a Dockerfile. It instructs to add the following lines: # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY .…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
43
votes
6 answers

Access Redis CLI inside a Docker container

I have Redis running inside of a docker container. docker run --rm -d --name "my_redis" redis I'd like to access it via CLI: If I run docker exec -it my_redis redis-cli the console becomes unresponsive until I leave the container (Ctrl + P, Ctrl +…
Andrzej Gis
  • 13,706
  • 14
  • 86
  • 130
43
votes
2 answers

Multiple images, one Dockerfile

How to create two images in one Dockerfile, they only copy different files. Shouldn't this produce two images img1 & img2, instead it produces two unnamed images d00a6fc336b3 & a88fbba7eede Dockerfile: FROM alpine as img1 COPY file1.txt . FROM…
John
  • 655
  • 2
  • 6
  • 12
43
votes
1 answer

How to view complete error message from 'docker stack ps'?

While following the docker tutorial, I ran into a problem while deploying a stack with the docker stack deploy command. The most information on the error I managed to obtain was from running the docker stack ps command, which displays a table with…
kamilk
  • 3,829
  • 1
  • 27
  • 40
43
votes
2 answers

docker-compose build args not passing to Dockerfile

docker-compose.yml: version: "3" services: ei: build: context: . dockerfile: Dockerfile args: NODE_VERSION: 8 HELLO: 5 Dockerfile: ARG NODE_VERSION ARG HELLO FROM node:$NODE_VERSION RUN echo "->…
basickarl
  • 37,187
  • 64
  • 214
  • 335
43
votes
4 answers

How do I reduce a python (docker) image size using a multi-stage build?

I am looking for a way to create multistage builds with python and Dockerfile: For example, using the following images: 1st image: install all compile-time requirements, and install all needed python modules 2nd image: copy all compiled/built…
gCoh
  • 2,719
  • 1
  • 22
  • 46
43
votes
5 answers

Docker: docker: Error response from daemon: linux spec user: unable to find user myuser: no matching entries in passwd file

[root@mymachine redisc]# docker run -p 6379:6379 --user myuser redisc docker: Error response from daemon: linux spec user: unable to find user myuser: no matching entries in passwd file. but i can become myuser on the host [root@mymachine redisc]#…
ealeon
  • 12,074
  • 24
  • 92
  • 173