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

How to make docker image of host operating system which is running docker itself?

I started using Docker and I can say, it is a great concept. Everything is going fine so far. I installed docker on ubuntu (my host operating system) , played with images from repository and made new images. Question: I want to make an image of…
node_analyser
  • 1,502
  • 3
  • 17
  • 34
42
votes
3 answers

How to extend an existing docker image?

I'm using the official elasticsearch Docker image instead of setting up my own elastic search instance. And that works great, up to the point when I wanted to extend it. I wanted to install marvel into that ElasticSearch instance to get more…
peter
  • 14,348
  • 9
  • 62
  • 96
41
votes
8 answers

docker-compose redis password via environment variable

I'm trying to pass my redis password using docker-compose via environment variable but it gives me errors. Here is part of mine docker-compose.yml with redis image: redis: image: redis container_name: redis # command: redis-server…
karambaq
  • 631
  • 3
  • 9
  • 24
41
votes
10 answers

Docker build: failed to fetch oauth token for openjdk?

I'm having trouble understanding this error when trying to build a project in Docker: > [internal] load metadata for docker.io/library/openjdk:11: ------ failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to…
Kespoco
  • 513
  • 1
  • 4
  • 5
41
votes
8 answers

How to keep Visual Studio or Docker from changing the host port numbers?

I have dockerized my web application and can run it within Visual Studio, however, the host port number it chooses to use is not consistent. Where do I configure it to always use the same port numbers?
adam0101
  • 29,096
  • 21
  • 96
  • 174
41
votes
7 answers

Manual workflow triggers in Github Actions

I am setting up Github Actions for a project repository. The workflow consists of the following steps: Building a docker image Pushing the image to a container registry Rollout a Kubernetes deployment. However, I have two different Kubernetes…
Antoine C.
  • 3,730
  • 5
  • 32
  • 56
41
votes
6 answers

The command could not be located because '/snap/bin' is not included in the PATH environment variable

when i try to run git-all-secrets i got Dockerfile: command not found and this is the command include correct information here is an example of the issue root@momo22:/home/momo/git-all-secrets# docker run -it abhartiya/tools_gitallsecrets…
ELMO
  • 581
  • 2
  • 5
  • 7
41
votes
3 answers

Cannot find the daemon.json file in windows 10 after docker-desktop installation

I installed the docker-desktop in windows 10 using the installer. Now i want to see the configuration file daemon.json. The official documentation says that The default location of the configuration file on Windows is…
AnjK
  • 2,887
  • 7
  • 37
  • 64
41
votes
4 answers

How to access files in host from a Docker Container?

I have a Docker Ubuntu Bionic container on A Ubuntu server host. From the container I can see the host drive is mounted as /etc/hosts which is not a directory. Tried unmounting and remounting on a different location but throws permission denied…
Just Khaithang
  • 1,217
  • 1
  • 14
  • 24
41
votes
9 answers

Failed to create endpoint on network nat: hnsCall failed in Win32: The process cannot access the file

I'm trying to run the following docker command (latest Win10 Fall 2018 update, latest docker version 2.0): docker run -d -p 1433:1433 -e sa_password=Test_123 -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer But it fails wit the following…
user3365017
  • 501
  • 1
  • 4
  • 7
41
votes
5 answers

Docker build complains it can't find nuget fallback package folder

I'm following the tutorial at https://learn.microsoft.com/en-us/dotnet/core/docker/docker-basics-dotnet-core#dockerize-the-net-core-application in learning to containerise .net core applications into Docker. Other than changing the Dockerfile to…
Colin Mackay
  • 18,736
  • 7
  • 61
  • 88
41
votes
3 answers

How do I identify which container owns which overlay directory?

My /var/lib/docker/overlay directory contains data for my containers but the directory names are all hashed. How can I determine which container owns which overlay?
Matthew
  • 10,361
  • 5
  • 42
  • 54
41
votes
2 answers

Kubernetes equivalent of `docker run --init`

It is a recommended best practice to not run dockerized Node.JS applications as PID 1 (see https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals) in order to correctly capture signals. The docker run command…
marcind
  • 52,944
  • 13
  • 125
  • 111
41
votes
4 answers

How to use multiple auths/ logins for same docker registry

I'm using latest gitlab and the integrated docker registry. For each project I create an individual deploy token. On the host where I want to deploy the images I do docker login https://registry.example.com/project1, enter the deploy token and get…
gucki
  • 4,582
  • 7
  • 44
  • 56
41
votes
1 answer

EF Core migrations in Docker container

I am setting up a WebApi in .NET Core 2.0. I will be using Entity Framework Core as ORM. Whole app will be deployed as Docker Container. The thing that disturbs me a bit is the way of handling DB migrations in this case. I mean PRODUCTION…
1 2 3
99
100