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
46
votes
1 answer

docker version number confusion: 17.06 vs 1.13?

I am confused by the version number of docker Some documentation refers to version numbers like 17.06 E.g. (from here) However, starting with Docker 17.06, you can also use --mount with standalone containers But some other documentation refers to…
leeyuiwah
  • 6,562
  • 8
  • 41
  • 71
46
votes
2 answers

where should I put docker-compose.yml

When I pull the images from docker hub. Sometimes, I would like to run the images in a multi-container way. So I choose to use docker-compose. For example, I would run the zookeeper in replicated mode. I will new a file named docker-compose.yml, and…
Dr.Bit
  • 719
  • 1
  • 6
  • 14
46
votes
1 answer

What is the purpose of the Docker build context?

What is the purpose of the Docker build context? I understand, from the documentation, that it's the "entry" point from which the entire contents will be sent to the docker daemon. But what's the point of sending the entire contents of the current…
frogstarr78
  • 860
  • 1
  • 7
  • 11
46
votes
4 answers

Docker Postgres Clear all Data

I'm running postgress inside a docker container. I'm trying to completely remove it and re-install. Everytime I start it seems to be 'restarting' rather than making a fresh instance. When I re-start the new instance I get a message like this…
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
46
votes
2 answers

what does fd:// mean exactly in dockerd -H fd://

Docker daemon documentation suggests the following hosts option for most setups: dockerd -H fd:// I guess fd stands for file descriptor. I don't understand how fd is used for socket communication. I understand the following options: -H…
Mert Nuhoglu
  • 9,695
  • 16
  • 79
  • 117
46
votes
1 answer

Docker temporary files strategy

My docker produces some temporary files. Is there an encouraged strategy regarding those? If I put those to /tmp, I'm not sure they'll get cleared. Or should I expose the volume /tmp from the host machine?
Augustin Riedinger
  • 20,909
  • 29
  • 133
  • 206
46
votes
3 answers

docker restart container failed: "already in use", but there's no more docker image

I first got my nginx docker image: docker pull nginx Then I started it: docker run -d -p 80:80 --name webserver nginx Then I stopped it: docker stop webserver Then I tried to restart it: $docker run -d -p 80:80 --name webserver nginx docker:…
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
46
votes
2 answers

Docker RabbitMQ persistency

RabbitMQ in docker lost data after remove container without volume. My Dockerfile: FROM rabbitmq:3-management ENV RABBITMQ_HIPE_COMPILE 1 ENV RABBITMQ_ERLANG_COOKIE "123456" ENV RABBITMQ_DEFAULT_VHOST "123456" My run…
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
46
votes
3 answers

How can I fix 'No space left on device' error in Docker?

I'm running a Mac-native Docker (no virtualbox/docker-machine). I have a huge image with a lot of infrastructure in it (Postgres, etc.). I have run cleanup scripts to get rid of a lot of cruft--unused images and so forth. When I run my image I get…
Greg
  • 10,696
  • 22
  • 68
  • 98
46
votes
2 answers

Make container accessible only from localhost

I have Docker engine installed on Debian Jessie and I am running there container with nginx in it. My "run" command looks like this: docker run -p 1234:80 -d -v /var/www/:/usr/share/nginx/html nginx:1.9 It works fine, problem is that now content of…
Pavel Štěrba
  • 2,822
  • 2
  • 28
  • 50
46
votes
4 answers

How to capture packets for single docker container

There have many container running on the host. And I want to capture packets for the one container of these. Is there any way to do this?
sope
  • 1,619
  • 5
  • 19
  • 37
46
votes
2 answers

Difference between service and container in docker compose

I was going through volumes_from option in docker compose. Apparently you can import a volumes from either a container or a service. From the docker compose documentation it is: volumes_from Mount all of the volumes from another service or…
Muhammad Raihan Muhaimin
  • 5,559
  • 7
  • 47
  • 68
46
votes
4 answers

Rails, Docker: Host does not exist: "default"

When I try to run docker-machine start default , I get Host does not exist: "default", I tried eval "$(docker-machine env default)", but still getting the same message. Where is the error ?
VPaskar
  • 667
  • 1
  • 6
  • 13
46
votes
4 answers

Why is ARG in a DOCKERFILE not recommended for passing secrets?

In http://docs.docker.com/engine/reference/builder/#arg , It recommendeds secrets are not passed through ARGS. Note: It is not recommended to use build-time variables for passing secrets like github keys, user credentials etc. At what point are…
Roger Lam
  • 962
  • 2
  • 8
  • 17
46
votes
6 answers

docker-compose not showing any changes to code

I am working on a project that uses docker-compose up to start up and run. I am not very familiar with docker-compose and I couldn't really find an answer in the docs. According to the docs the up command rebuilds the container from the docker file,…
eignhpants
  • 1,611
  • 4
  • 26
  • 49