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
42
votes
4 answers

Docker run does not display any output

I installed docker on a raspberry-pi (Connected via ssh) Installation is successful. But running docker run hello-world produce no output. Note on very first time I got additional messages regard installing image Unable to find image…
shakthi
  • 1,597
  • 2
  • 17
  • 29
42
votes
3 answers

Why COPY package*.json ./ precedes COPY . .?

In this Node.js tutorial on Docker: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ What is the point of COPY package*.json ./? Isn't everything copied over with COPY . .? The Dockerfile in question: FROM node:8 # Create app…
Jakub Barczyk
  • 565
  • 1
  • 4
  • 11
42
votes
8 answers

How to Use Environment Variables in a .env file to fill out other environment variable in the same .env file

I am using a base.env as an env_file for several of my docker services.In this base.env I have several parts of the environment variable that repeat throughout the file. For example, port and ip are the same for three different environment…
Peter Kaufman
  • 752
  • 1
  • 6
  • 18
42
votes
7 answers

DNS not working within docker containers when host uses dnsmasq and Google's DNS server are firewalled?

The symptom is: the host machine has proper network access, but programs running within containers can't resolve DNS names (which may appear to be "can't access the network" before investigating more). $ sudo docker run -ti mmoy/ubuntu-netutils…
Matthieu Moy
  • 15,151
  • 5
  • 38
  • 65
42
votes
1 answer

What does "Thin Pool" in docker mean?

I guess this should be pretty elementary but I've tried to google it and I've read the docker documentation. However, I still can't grasp what exactly does "Thin Pool" mean and the role it plays in the docker world.
Antonio Gomez Alvarado
  • 1,842
  • 2
  • 13
  • 24
42
votes
6 answers

Postgres image is not creating database

According to these docs, I can specify the name of the database created by the postgres docker image with the env var POSTGRES_DB. I have set it in my docker-compose file, but it isn't being created. Here's relevant section from the compose…
gardenhead
  • 2,299
  • 2
  • 19
  • 17
42
votes
9 answers

Kubernetes Readiness probe failed error

While running my container on kubernetes using helm upgrade command, I am getting this error: 'Readiness probe failed: Get http://172.17.0.6:3003/: dial tcp 172.17.0.6:3003: getsockopt: connection refused'. My docker image is for a node.js…
Karan Sodhi
  • 569
  • 1
  • 4
  • 7
42
votes
2 answers

What is a container manifest?

The only doc on this topic seems to assume I already know what a manifest is, the problem it solves, and how it fits into the docker ecosystem. After reading the doc I'm still not sure how manifests actually work. My private GCR contains manifest…
red888
  • 27,709
  • 55
  • 204
  • 392
42
votes
10 answers

How to change the default character set of mysql using docker-compose?

When I save the string of Chinese, mysql rise the error "Exception Value: (1366, "Incorrect string value: '\xE5\xB0\x8F\xE6\x98\x8E' for column 'name' at row 1")",I check the character of mysql,it show this: mysql> show variables like…
叶同学
  • 801
  • 1
  • 9
  • 21
42
votes
6 answers

How to run docker with experimental functions on Ubuntu 16.04

I have following question: How to run docker with experimental features on (like image squashing docker build --squash=true... for reduce it size) on ubuntu 16.04 ?
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
42
votes
1 answer

docker service update: "image could not be accessed on a registry to record it's digest"

I have an image on Amazon's Elastic Container Registry (ECR) that I want to deploy as a Docker service in my Docker single-node swarm. Currently the service is running an older version of the image's latest tag, but I've since uploaded a newer…
David Elner
  • 5,091
  • 6
  • 33
  • 49
42
votes
7 answers

Docker save/load lose original image repository/name/tag

I'm using Docker 1.12.6. I have pulled an image from the Docker registry. I have exported the images as tar files using the docker save command. I removed the original image and container and loaded the exported image using docker load -i…
Zizou
  • 831
  • 1
  • 10
  • 19
42
votes
1 answer

Use docker-compose with multiple repositories

I'm currently struggling with the deployment of my services and I wanted to ask, what's the proper way when you have to deal with multiple repositories. The repositories are independent, but to run in production, everything needs to be launched. My…
Mathias Aichinger
  • 883
  • 2
  • 8
  • 16
42
votes
9 answers

Docker - No route to host

When i try and connect to a port from within my container to another container, i am unsuccessful and get, root@ac1590a59fe5:/opt/f5massupgrade# curl -v https://172.17.0.1:6379 * Rebuilt URL to: https://172.17.0.1:6379/ * Hostname was NOT found in…
felix001
  • 15,341
  • 32
  • 94
  • 121
42
votes
6 answers

Docker number of lines in terminal changing inside docker

I would like to know how to change the following behavior. Let's say my terminal has 28 lines. Then I use the following commands: $ tput lines # my terminal 28 $ docker run --rm -it ubuntu:16.04 tput lines # docker container 24 ## WHY?? $ docker…
silgon
  • 6,890
  • 7
  • 46
  • 67