Docker

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: docker image tag ol...

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

A Beginner's Guide to Docker Compose

Learn all about Docker Compose so you can orchestrate your services with confidence!

Docker
Docker Compose
Guides · Better Stack ·  Updated on December 22, 2023

Docker Security: 14 Best Practices You Should Know

Learn 14 Docker best practices to ensure that your deployments are robust, resilient, and ready to meet the challenges of modern security threats.

Best Practices
Docker
Security
Guides · Better Stack ·  Updated on January 8, 2024

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

Scaling Node.js Applications with Clustering

Due to Node.js's architecture, deploying a Node.js application on a machine with multiple CPUs typically runs as a single instance on a single CPU, responsible for handling all incoming requests. T...

Docker
Node.js
PM2
Guides · Better Stack ·  Updated on March 21, 2024

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 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 February 4, 2023

Building Production-Ready Docker Images for PHP Apps

Learn about Docker images and containers, putting together a `Dockerfile`, and building a fully custom Docker image for deploying PHP apps to production

Docker
Laravel
PHP
Guides · Better Stack ·  Updated on April 12, 2024

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 October 5, 2023

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: the input device is not a TTY How t...

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

Deploying Django Apps with Docker: A Step-by-Step Guide

This article provides step-by-step instructions for deploying your Django applications using Docker and Docker Compose

Django
Docker
Python
Guides · Better Stack ·  Updated on December 1, 2023

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 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: Got permission denied while trying to connect to the Docker daemon socket

This error may appear when running docker commands and it is caused by insufficient privilages. Solution To resolve the problem, you need to do the following: Create a docker group sudo groupadd do...

Docker
Questions · Better Stack ·  Updated on November 9, 2023

How to Start Docker Containers Automatically After a Reboot?

Docker provides restart policies to control whether your containers start automatically when they exit, or when Docker restarts. Restart policies ensure that linked containers are started in the co...

Docker
Questions · Better Stack ·  Updated on October 11, 2023

How to Administer and Maintain a Docker Swarm Cluster

Learn how to administer a Docker Swarm cluster by adding nodes, gracefully removing them, or changing a node's role within the cluster

Docker
High Availability
Scaling Docker
Guides · Better Stack ·  Updated on December 22, 2023

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 December 22, 2023

Exploring Podman: A More Secure Docker Alternative

This article explore Podman's features and benefits, comparing it to Docker and describing a step-by-step migration guide

Docker
Podman
Guides · Better Stack ·  Updated on January 15, 2024

Logging in Docker: Everything You Need to Know

This comprehensive guide covers everything you need to know about collecting, managing, and centralizing Docker container and daemon logs in production

Docker
Dozzle
Logging
Guides · Better Stack ·  Updated on January 29, 2024

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

Auto Scaling
Docker
High Availability
Guides · Better Stack ·  Updated on January 9, 2024

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

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

Docker
Node.js
Guides · Better Stack ·  Updated on December 22, 2023

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 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: docker ...

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

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 pass environment variables to a Docker container?

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 October 11, 2023

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: docker info Output: ... Storage Driver: <driver-name> Docker Root Dir: /var/li...

Docker
Questions · Better Stack ·  Updated on October 5, 2023

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 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: ... services: app: ...

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 March 16, 2023

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

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 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: docker container ls This command is valid on a...

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

Docker Swarm vs Kubernetes: A Practical Comparison

Explore the pros and cons of Docker Swarm and Kubernetes and gain valuable insights to help you choose the right solution for your infrastructure needs.

Docker
Docker Swarm
Kubernetes
Guides · Better Stack ·  Updated on December 22, 2023

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 ping Docker container from another container by name?

The feather of accessing or pinging containers from other containers using their name rather than their IP address comes out of the box with docker networks. For this, you will need two (or more) c...

Docker
Questions · Better Stack ·  Updated on November 9, 2023

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 October 5, 2023

How to view log output using docker-compose run?

You can start Docker compose in detached mode and attach yourself to the logs of all containers later. If you're done watching logs you can detach yourself from the logs output without shutting dow...

Docker
Questions · Better Stack ·  Updated on October 11, 2023

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: docker rmi -f $(docker...

Docker
Questions · Better Stack ·  Updated on August 1, 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

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: ADD . /path/...

Docker
Questions · Better Stack ·  Updated on October 5, 2023

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