Docker

Setting up Docker Swarm High Availability in Production

Learn key concepts in Docker Swarm and set up a highly available Swarm cluster that is resilient to failures

Docker
High Availability
Guides · Better Stack ·  Updated on September 25, 2022

[2 min installs] Docker on Ubuntu

Here is how to install Docker on your Ubuntu 20.04 system in under two minutes: Step 1 - Download Docker package Go to https://download.docker.com/linux/ubuntu/dists/ (https://download.docker.com/l...

Ubuntu
Installs
Docker
Guides · Better Stack ·  Updated on August 30, 2022

How to Deploy Node.js Applications with Docker

Learn how to deploy your Node.js application in a Docker container and some best practices for writing Docker files

Node.js
Docker
Guides · Better Stack ·  Updated on June 2, 2022

How to Scale Docker Swarm Horizontally in Production

Learn how to horizontally scale in/out an existing Docker Swarm cluster, experiment with scalability constraints, and investigate auto scaling solutions

Docker
High Availability
Auto Scaling
Guides · Better Stack ·  Updated on September 26, 2022

What Is the Difference between the ‘COPY’ and ‘ADD’ Commands in a Dockerfile?

When creating a Docker file, you may need to transfer some files from the host system to the docker image. Those files may be for example libraries or any other files that your application may need...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

Where Are Docker Images Stored on the Host Machine?

If you want to have a quick look at where is Docker storing your Docker images, you can use the docker info command: bash docker info bash Output: ... Storage Driver: <driver-name> Docker Root D...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Get Started with Logging in Docker

Learn how to start logging with Docker and go from basics to best practices in no time.

Docker
Guides · Better Stack ·  Updated on February 24, 2022

What Is the Difference between a Docker Image and a Container?

Docker image A Docker image ****is an immutable (unchangeable) file that contains the source code, libraries, dependencies, tools, and other files needed for an application to run. Sometimes these ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How To Deal With Persistent Storage (e.g. Databases) In Docker?

The best way to deal with persistent data storage (such as a database) in Docker is to use Docker’s volume API (for docker 1.9.0 or newer) or use data-only containers for older versions of Docker. ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Fix Docker Permission Denied Issue?

If you are struggling with the Docker permission denied error, we have prepared a quick fix for you. Step 1 - Create a docker group The first step is you create a docker group if you haven’t done i...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

Docker How to Change Repository Name or Rename Image?

Docker image Docker image name and tag are just an alias to a docker image id that looks similar to this d583c3ac45fd. If you want to change the name, run the following command: bash docker image t...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

Should I Use Vagrant or Docker for Creating an Isolated Environment?

This depends on what exactly you want to do. The short answer would be that if you want to manage virtual machines, you want to use Vagrant. If you want to build and run an application environment,...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Execute Multiple Commands in Docker-Compose?

It is possible to define and run multiple commands in the docker-compose.yml file. To execute multiple commands using Docker-Compose, structure the file in the following way: bash ... services: a...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Connect to the Localhost of the Machine from inside of a Docker Container?

If you are running some kind of a server or any other service (such as a database) on localhost and the service isn’t exposing any port, you may have found yourself wondering how to connect to this...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Copy Docker Images from One Host to Another without Using a Repository

There is an easy way to transfer Docker images from one host to another without using any repository. Copy Docker images from one host to another First, you need to save the docker image as a tar: ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Remove a Docker Image?

To remove one or more specific images, you can use the docker rmi command. How to list all images If you want to list all the images before removing any, you can do they by running the following co...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

What Is the Difference between Docker-Compose Ports and Expose?

You may have wondered what is the difference between docker-compose ports and docker-compose expose. Here is a clear explanation to help you better understand the matter. Ports Ports mentioned in t...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Copy Files from Host to Docker Container?

When creating a docker image, you may want to copy some files from the host machine to the docker image. These files may be native libraries, configuration files, or any other files that will be ne...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Explore Docker Container’s File System?

If you want to explore the Docker container’s file system, you can use on of the following methods. Using the docker exec command Docker version 1.3 or newer supports the docker exec command. This ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Get a Docker Container’s Ip Address from the Host?

By default, the container is assigned an IP address for every Docker network it connects to. And each network is created with a default subnet mask, using it as a pool, later on, to give away the I...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Mount a Host Directory in a Docker Container?

If you want to mound a host directory in a Docker container, you have to main ways to do that: Using the ADD command: The simplest way is to use the dockers ADD command as shown below: bash ADD . /...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Delete All Local Docker Images?

If you have a large number of docker containers and images, you can remove them all at once. Remove all docker images To delete all docker images, run the docker rmi command: bash docker rmi -f $(d...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How Do I Pass Environment Variables to Docker Containers?

It is always a good practice to separate the app from its configuration. It is not a good idea to have a database login credential defined as variables in the code of the application. This is why w...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Remove Old Docker Containers?

You may have found docker rm command to remove a docker container. However, this works only for a single container and it would be very painful to run this command for every non-running docker cont...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Include Files outside of Docker’s Build Context?

You may have ended up in a situation where you wanted to include a file from outside of Docker's build context using the ADD command, but the ADD command requires the path to be within the build co...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How Do I Get into a Docker Container’s Shell?

If you want to explore containers file system it simply wan to get an access to containers shell, you can use one of the following options Using the docker exec command Docker version 1.3 or newer ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Remove Old and Unused Docker Images?

Since the docker version 1.13 you can use the docker prune command to remove all dangling data such as containers stopped, volumes without containers, and images with no containers. To remove dangl...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How Do I Edit a File inside a Docker Container?

If you want to edit a file inside a docker container, you can follow these steps: 1. Find the id of the container To find the id of the running container, you can use the following command: bash do...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Force Docker to Clean Build an Image?

When executing docker pull or docker run command, the daemon first checks for a similar image in the local machine by comparing the digests of the image. If it finds a match, the daemon simply crea...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Copy Files from Docker Container to Host?

Before Docker 1.8, we could only copy files from the container to the host. However, as containers became even more popular, copying files to and from containers has become necessary. One of the re...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

What Is the Difference between CMD and ENTRYPOINT in a Dockerfile?

There is a big confusion around similarity and lack of clarity in the difference between the CMD and ENTRYPOINT instruction in Docker. Let’s clear things up. See the example Let’s say we want to cr...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to Run a Docker Image as a Container?

Docker runs processes in isolated containers. A container is a process that runs on a host. The host may be local or remote. When an operator executes docker run, the container process that runs is...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

How to List Containers in Docker?

Running containers If you want to list all the running docker containers, you can use the docker container ls command, which takes the following form: bash docker container ls This command is vali...

Docker
Questions · Better Stack ·  Updated on August 1, 2022

Solved: The Input Device Is Not a TTY

If you try to execute a command inside the docker using the Jenkins or jus try to use the -it option in the docker run command, you will get the following error: bash the input device is not a TTY ...

Docker
Questions · Better Stack ·  Updated on August 1, 2022