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
3 answers

Add bind mount to Dockerfile just like volume

I want to add the bind mount to docker file just like I initialise a volume inside Dockefile. Is there any way for it?
Mufeed
  • 3,018
  • 4
  • 20
  • 29
43
votes
2 answers

Docker Compose Relative paths vs Docker volume

I have a docker compose file for a website, which amongst a bunch of other containers for various purposes, includes a mysql database that will have persistent data. At the moment the compose file specifies a relative path for the data, e.g.: …
statts
  • 435
  • 1
  • 4
  • 4
43
votes
5 answers

ERR_EMPTY_RESPONSE from docker container

I've been trying to figure this out in the last hours but I'm stuck. I have a very simple Dockerfile which looks like this: FROM alpine:3.6 COPY gempbotgo / COPY configs /configs CMD ["/gempbotgo"] EXPOSE 8025 gempbotgo is just an go binary which…
gempir
  • 1,791
  • 4
  • 22
  • 46
43
votes
6 answers

How can I forward a port from one docker container to another?

I commonly see solutions that expose a docker container's port to the host. In my case I want to forward a local port from one container, to another. Let's say I run a service on container A that has a hard-coded configuration to access db on…
Marinos An
  • 9,481
  • 6
  • 63
  • 96
43
votes
5 answers

Docker fails to start due to "volume store metadata database: timeout"

I have followed the installation instructions of Docker CE for CentOS. Initially this worked. At some point the system was restarted and now starting Docker fails. Appreciate expert eyes on this matter... systemctl start docker produces: Job for…
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
43
votes
2 answers

How do you start a Docker-ubuntu container into bash?

The answers from this question do not work. The docker container always exits before I can attach or won't accept the -t flag. I could list all of the commands I've tried, but it's a combination of start exec attach with various -it flags and…
Andrew
  • 839
  • 2
  • 7
  • 16
43
votes
2 answers

Docker + Virtual Box = VT-x is not available (VERR_VMX_NO_VMX)

I installed docker. During installation, it complained that you can't have two virtualization environments, and that it would make docker the primary one. I said: "OK." Now, I need to go back to enabling virtualbox. I uninstalled Docker, hoping it…
DrDamnit
  • 4,736
  • 4
  • 23
  • 38
43
votes
4 answers

Docker image running a Mac OS X installation

I am using Docker for Mac and wish to create Docker image running a Mac El Capitan with my development env. I am not finding any resources on this. All I see is Linux installations. On Linux I saw things as simple as: FROM sciensa2/docker-java8 RUN…
Vik
  • 8,721
  • 27
  • 83
  • 168
43
votes
3 answers

Why doesn't my newly-created docker have a digest?

I have been following the Docker tutorial here, and built a test image on my local OSX machine by committing changes to an existing image and tagging it with three different labels: # docker images REPOSITORY TAG IMAGE…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
43
votes
1 answer

How to tag an image in a Dockerfile?

I have been digging the documentation, but I did not find an instruction to define the tag name of an image in a Dockerfile. There is one available for the command line though. Say I create an image FROM another image, I don't want it to bear the…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
43
votes
1 answer

How do I declare multiple maintainers in my Dockerfile?

How can I best indicate that there are multiple authors/maintainers of a docker image built using a Dockerfile? If I include multiple separate MAINTAINER commands, only the last one seems to take effect. MAINTAINER Me Myself…
amacleod
  • 1,450
  • 2
  • 15
  • 23
43
votes
9 answers

Mounted volume is empty inside container

I've got a docker-compose.yml like this: db: image: mongo:latest ports: - "27017:27017" server: image: artificial/docker-sails:stable-pm2 command: sails lift volumes: - server/:/server ports: - "1337:1337" links: -…
Hedge
  • 16,142
  • 42
  • 141
  • 246
43
votes
4 answers

Create named docker volume with docker-compose?

I'm on docker version 1.11.2. I'm able to create named docker volumes: docker volume create --name my-jenkins-volume Than I'm able to connect my container with the named-volume with the -v option: docker run -d -u jenkins --name jenkins -p…
lvthillo
  • 28,263
  • 13
  • 94
  • 127
43
votes
10 answers

Docker: "lstat no such file or directory" error when building image. File is there

I want to deploy a simple JS Boilerplate to Docker Cloud. I use a Dockerfile that I already used for a different Boilerplate and image. The Dockerfile is pretty simple. It is just based on the official nginx, adds two config files and then the…
Ole Spaarmann
  • 15,845
  • 27
  • 98
  • 160
43
votes
4 answers

How can I connect my autoscaling group to my ecs cluster?

In all tutorials for ECS you need to create a cluster and after that an autoscaling group, that will spawn instances. Somehow in all these tutorials the instances magically show up in the cluster, but noone gives a hint what's connecting the…
cari
  • 2,251
  • 2
  • 18
  • 27