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
45
votes
8 answers

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

I have installed docker on ubuntu 14.04, it told me installed successfully. Then I entered sudo docker version, it returned Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20…
thiiiiiking
  • 1,233
  • 3
  • 12
  • 16
45
votes
2 answers

SIGTERM not received by java process using 'docker stop' and the official java image

I am running a dropwizard Java application in a Docker container using the image java:7u79 based on debian/jessie. My Java application handles the SIGTERM signal to shutdown gracefully. The SIGTERM handling works perfect when I run the application…
Sunil Kumar
  • 1,631
  • 2
  • 19
  • 33
45
votes
1 answer

How can I know why a Docker container stopped?

I have a Docker container that contains a JVM process. When the process ends the container completes and stops. While thankfully rare, my JVM can go legs-up suddenly with a hard-failure, e.g. OutOfMemoryError. When this happens my container just…
Greg
  • 10,696
  • 22
  • 68
  • 98
45
votes
6 answers

restart nginx container when upstream servers is updated

I want to add/remove servers in my nginx running inside a docker container I use ADD command in Dockerfile to add my nginx.conf to /etc/nginx dir. # Copy a configuration file from the current directory ADD nginx.conf /etc/nginx/ then in my running…
Hokutosei
  • 2,114
  • 5
  • 24
  • 42
44
votes
10 answers

Docker: COPY failed: file not found in build context (Dockerfile)

I'd like to instruct Docker to COPY my certificates from the local /etc/ folder on my Ubuntu machine. I get the error: COPY failed: file not found in build context or excluded by .dockerignore: stat etc/.auth_keys/fullchain.pem: file does not…
Jaco
  • 1,564
  • 2
  • 9
  • 33
44
votes
14 answers

Docker Failed to Start

I have installed the Docker and then I have started the Docker. Docker says that "Docker is starting." Then,Docker says "Docker Failed to Start". Please, Could you help me? Docker Error Detail: System.InvalidOperationException: Failed to deploy…
Yavuz Yoldaş
  • 841
  • 1
  • 9
  • 19
44
votes
4 answers

Getting docker build to show IDs of intermediate containers

I'm trying to learn docker but experience some discrepancies to what I've read in each tutorial: When using the following command docker build -t my-app:1.0 . my build fails due to some error in my Dockerfile. Following this answer, I wanted to run…
Comfort Eagle
  • 2,112
  • 2
  • 22
  • 44
44
votes
5 answers

Difference between "WSL2+docker desktop windows" and directly install docker on the WSL2 distro?

Why is it recommended to run WSL2+docker desktop windows, instead of directly install docker on the WSL2 distro ? It seems that both work but I read that the way to go is with docker desktop, I'm trying to understand why. Thank you
ant31
  • 4,471
  • 4
  • 15
  • 20
44
votes
9 answers

Docker container exiting immediately after starting when using npm init react-app

I am trying to start a Docker container with a react project, the project is created using npm init react-app. This is my docker file # Specify a base image FROM node:alpine WORKDIR /usr/app # Install some depenendencies COPY ./package.json…
Jason McFarlane
  • 2,048
  • 3
  • 18
  • 30
44
votes
2 answers

google-chrome Failed to move to new namespace

Im trying to run google-chrome --headless inside a docker container as a non-root user to execute some tests. Everytime Im trying to start it, it throws following error: google-chrome --headless Failed to move to new namespace: PID namespaces…
44
votes
2 answers

How to install packages with miniconda in Dockerfile?

I have a simple Dockerfile: FROM ubuntu:18.04 RUN apt-get update RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/* RUN wget \ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && mkdir /root/.conda \ &&…
maciek
  • 1,807
  • 2
  • 18
  • 30
44
votes
3 answers

How to implement changes made to docker-compose.yml to detached running containers

The project is currently running in the background from this command: docker-compose up -d I need to make two changes to their docker-compose.yml: Add a new container Update a previous container to have a link to the new container After changes…
skplunkerin
  • 2,123
  • 5
  • 28
  • 40
44
votes
2 answers

Python 3.7 Docker images

I want to dockerize my python app. I went to Docker hub and discovered that there are a variety of likely-sounding base images. 3.7.0-stretch, 3.7-stretch, 3-stretch, stretch (3.7/stretch/Dockerfile) 3.7.0-slim-stretch, 3.7-slim-stretch,…
David Goldfarb
  • 1,796
  • 3
  • 18
  • 32
44
votes
6 answers

Debug PHP with VSCode and Docker

I'm trying to debug a PHP app running on Docker with VSCode, but without success. In the past I was able to easily debug my PHP apps with VSCode running WAMP Server, but since I started working with Docker I'm unable to get debug working. Searched…
Ricky
  • 2,912
  • 8
  • 47
  • 74
44
votes
2 answers

Minikube vs Kubernetes in Docker for Windows

Most tutorials I've seen for developing with Kubernetes locally use Minikube. In the latest Edge release of Docker for Windows, you can also enable Kubernetes. I'm trying to understand the differences between the two and which I should…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311