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

Docker NLTK Download

I am building a docker container using the following Dockerfile: FROM ubuntu:14.04 RUN apt-get update RUN apt-get install -y python python-dev python-pip ADD . /app RUN apt-get install -y python-scipy RUN pip install -r…
GNMO11
  • 2,099
  • 4
  • 19
  • 28
46
votes
2 answers

How to install nano on boot2docker

I'm running the boot2docker VM in windows and need to modify the init scripts within the VM. Currently my only option is VI, and it's a pain. I'd just like to use nano, but it's not available. It's running: docker@boot2docker:/c$ uname -a Linux…
phazei
  • 5,323
  • 5
  • 42
  • 46
46
votes
8 answers

How to build Docker Images with Dockerfile behind HTTP_PROXY by Jenkins?

Building Docker images works in a desktop without a problem. Installing Node.js NPM dependencies work as usual. However, when using a continuous integration server such as Jenkins that is hosted behind a corporate proxy, the build Docker Images…
Marcello DeSales
  • 21,361
  • 14
  • 77
  • 80
46
votes
1 answer

What happens when the docker host restarts?

What happens when the docker host is shut down and restarted? will the images that were running be restarted? will the changes that were made to those images persist, or will a new instance of the image be spawned and changes be lost? does docker…
Mildred
  • 3,887
  • 4
  • 36
  • 44
46
votes
2 answers

How to map volume paths using Docker's --volumes-from?

I'm new to Docker and am excited about using the --volumes-from feature but there's something I'm not understanding. If I want to use --volumes-from with two data-only containers, each of which exports volumes named /srv, how to I prevent the volume…
David Braun
  • 5,573
  • 3
  • 36
  • 42
46
votes
3 answers

Is there a maximum number of containers running on a Docker host?

Basically, the title says it all: Is there any limit in the number of containers running at the same time on a single Docker host?
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
46
votes
6 answers

Limit memory on a Docker container doesn't work

I am running the last version of Docker on top of Ubuntu 13.04 (Raring Ringtail): root@docker:~# docker version Client version: 0.6.6 Go version (client): go1.2rc3 Git commit (client): 6d42040 Server version: 0.6.6 Git commit (server): 6d42040 Go…
Disco
  • 4,226
  • 11
  • 58
  • 76
45
votes
2 answers

Getting message about docker wanting to create symlink every time I start Mac

(Almost) every time I start up my Mac, I get the the following message: Docker Desktop wants to create /var/run/docker.sock symlink. Touch ID or enter your password to allow this. Anybody knows how to get rid of this? I allow it every time, but it…
Sameh
  • 666
  • 5
  • 9
45
votes
4 answers

How to enable/disable buildkit in docker?

I got this command from the documentation, but i really have no idea how can I use it or where should I start to move, I'm new to docker, and concepts are still hard to me to digest: $ DOCKER_BUILDKIT=1 docker build . How can I use this command to…
Code Eagle
  • 1,293
  • 1
  • 17
  • 34
45
votes
1 answer

permission denied in docker-compose on linux

(base) a@a-ThinkPad-T440:~$ docker-compose version bash: /usr/local/bin/docker-compose: Permission denied I have big problem with docker-compose, I tried to upgrade docker-compose to 1.25 with curl but now I have no permission for docker-compose (I…
Z.Dubeau
  • 463
  • 1
  • 4
  • 8
45
votes
7 answers

The docker client must be run elevated to connect

When I am trying to built docker app, I am getting below error. Command I am running is docker build -t node_curd_exe . error during connect: Post…
Ashwani Panwar
  • 3,819
  • 3
  • 46
  • 66
45
votes
16 answers

Permission issues while docker push

I'm trying to push my docker image to google container image registry but get an error which says I do not have the needed permission to perform this operation. I have already tried gcloud auth configure-docker but it doesn't work for me. I first…
Srishti Rawal
  • 594
  • 1
  • 5
  • 15
45
votes
5 answers

How to change the network of a running docker container?

I'm trying to update the network of a running docker container. Note: I didn't attach any network while running the container. [root@stagingrbt ~]# docker network connect host cdf8d6e3013d Error response from daemon: container sharing network…
sudhir tataraju
  • 1,159
  • 1
  • 14
  • 30
45
votes
5 answers

Is it possible to run containers on android devices?

I’m a mobile developer and recently adept at using containers with docker. I’m developing a container architecture for my graduate project. One of the modules of this architecture would need to be run on an android device. But I could not find…
Thomas Marques
  • 981
  • 2
  • 7
  • 16
45
votes
4 answers

Building a multi-stage Dockerfile with --target flag builds all stages instead of just the specified one

From the docker build docs, you can specify a --target flag with the name of the stage to build it. Also, the same is specified in the multi-stage build docs. When you build your image, you don’t necessarily need to build the entire Dockerfile…
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206