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

What does docker container exit status 255 mean?

The doc mentions You can use a filter to locate containers that exited with status of 137 meaning a SIGKILL(9) killed them I'm wondering does exit status 255 mean anything special?
Gnimuc
  • 8,098
  • 2
  • 36
  • 50
45
votes
15 answers

Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\app\aspnetapp.csproj]

https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp Docker command docker build -t aspnetapp. I am getting an error for docker build command as C:\Program Files\dotnet\sdk\2.1.105\NuGet.targets(104,5): error : Unable to load the…
Pavan sharma
  • 451
  • 1
  • 4
  • 4
45
votes
3 answers

How to install python in a docker image?

I want to create a docker image with selenium and chrome correctly installed, so I choose a base image with these properties. Therefore, the first line of the Dockerfile is as follows: FROM selenium/node-chrome:3.7.1-argon Then the next command is…
Alex
  • 41,580
  • 88
  • 260
  • 469
45
votes
2 answers

How to specify working directory for ENTRYPOINT in Dockerfile

The Docker image (Windows-based) includes an application directory at C:\App. Inside that directory reside several sub-folders and files, including a batch file called process.bat. The Dockerfile (used to build the image) ends like this: ENTRYPOINT…
Web User
  • 7,438
  • 14
  • 64
  • 92
45
votes
3 answers

How to increase shm size of a kubernetes container (--shm-size equivalent of docker)

By default docker uses a shm size of 64m if not specified, but that can be increased in docker using --shm-size=256m How should I increase shm size of a kuberenetes container or use --shm-size of docker in kuberenetes.
anandaravindan
  • 2,401
  • 6
  • 25
  • 35
45
votes
5 answers

Can I run an intermediate layer of a Docker image?

When I fetch a Docker image from a repository I see that it pulls a bunch of layers with some ids, but when I try to run them using docker run it tells me that it can't find it. Can I run a certain layer of a Docker image that I can see through…
achabahe
  • 2,445
  • 1
  • 12
  • 21
45
votes
1 answer

How do I run the same docker-compose.yml several times on same docker daemon with different names?

My situation. Trying to run a docker-compose structure several times on the same box. This is my docker-compose.yml: version: '3' services: code: image: organization:java-maven links: - mysql:mysql volumes: -…
Wrench
  • 4,070
  • 4
  • 34
  • 46
45
votes
2 answers

how does Docker Embedded DNS resolver work?

I know Docker has a embedded Dns resolver. when I run a container in myself bridge: $ docker run -it --rm --privileged --network=mybridge xxx bash root@18243bfe6b50:/# cat /etc/resolv.conf nameserver 127.0.0.11 options ndots:0 …
sai
  • 451
  • 1
  • 4
  • 4
45
votes
4 answers

How many containers should exist per host in production? How should services be split?

I'm trying to understand the benefits of Docker better and I am not really understanding how it would work in production. Let's say I have a web frontend, a rest api backend and a db. That makes 3 containers. Let's say that I want 3 of the front…
Terence Chow
  • 10,755
  • 24
  • 78
  • 141
45
votes
5 answers

Simplest way of passing all host environment variables to docker container

Using docker run with a bunch of -e flags or even a .env seems cumbersome. Is there any simply way to just pass all of the host env variables to a docker container
user1686342
  • 1,265
  • 1
  • 18
  • 24
45
votes
3 answers

Default Docker entrypoint

I am creating an image from another image that set a specific entrypoint. However I want my image to have default one. How do I reset the ENTRYPOINT? I tried the following Dockerfile: FROM some-image ENTRYPOINT ["/bin/sh", "-c"] Unfortunately it…
Eugene Dounar
  • 1,134
  • 1
  • 10
  • 10
45
votes
5 answers

How to install extension for php via docker-php-ext-install?

In order to resolve an issue, I am now trying install the mysql pdo via docker-php-ext-install as pointed out in the README of the php image. Yet my call fails stating: Libraries have been installed in: /usr/src/php/ext/mysqli/modules If you…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
45
votes
2 answers

Is Docker Compose suitable for production?

I like the idea of modularizing an applications into containers (db, fronted, backed...) However, according to Docker docs "Compose is great for development, testing, and staging environments". The sentence tells nothing about production…
Lukasz Dynowski
  • 11,169
  • 9
  • 81
  • 124
45
votes
1 answer

Pass a variable to a Dockerfile from a docker-compose.yml file

I have several docker-compose.yml files that I want to use the same Dockerfile with, with a slight variation. So I want to pass an argument to that Dockerfile so that I can do something slightly different depending on whatever value the variable is…
lukeaus
  • 11,465
  • 7
  • 50
  • 60
45
votes
4 answers

Copy folder with wildcard from docker container to host

Creating a backup script to dump mongodb inside a container, I need to copy the folder outside the container, Docker cp doesn't seem to work with wildcards : docker cp mongodb:mongo_dump_* . The following is thrown in the terminal : Error…
Abdelrahman Elkady
  • 2,518
  • 2
  • 21
  • 30