ShellHacks
Command-Line Tips and Tricks

docker

  • Blog

Docker Compose: Pull Latest Image Version

Posted on February 10, 2022February 8, 2022by admin

The docker-compose up command doesn’t check a registry for a newer version of an image if it finds the image:latest among the locally cached images. So after a while you may find, that despite of the :latest tag of the image in a docker-compose.yml file, the docker-compose up command doesn’t pull the latest version of […]

Read More
No comments yet
  • Blog

Docker Compose: Set Environment Variables

Posted on October 27, 2021November 12, 2021by admin

In a Docker Compose, you can set environment variables in a service’s containers or overwrite variables that are defined in the Dockerfile of the images you’re running. To pass the environment variables to the containers, you can use the environment key in a docker-compose.yml file, that works just like a docker run -e VAR=VALUE … […]

Read More
1 Comment
  • Blog

Docker Compose: (re)Start|Stop|Build – Single Service

Posted on October 19, 2021October 19, 2021by admin

By default, the docker-compose (up|stop|restart|build) commands will start, stop, restart or build all of the services (containers) listed in a docker-compose.yml file. But there is also a way to run docker-compose commands against the certain containers only. This is useful when you need for example to re-build just one container described as a service in […]

Read More
1 Comment
  • Blog

Docker Compose: Detached Mode (Background)

Posted on October 19, 2021October 19, 2021by admin

By default, a Docker Compose starts the services in the foreground mode just like a docker run command. To run the Docker Compose in the background, a docker-compose up command should be started with the -d or –detach option. In this short note i am showing how to run the Docker Compose in the detached […]

Read More
No comments yet
  • Blog

Docker Compose: Specify Dockerfile Path – Example

Posted on January 27, 2021by admin

The docker-compose build or docker-compose up –build commands read the docker-compose.yml file looking for all services containing the build configuration option and run a docker build command for each of them. If the Dockerfile has been renamed or placed out of the context directory, you can specify the alternate path in the Docker Compose file. […]

Read More
No comments yet
  • Blog

Docker: Remove All Images & Containers

Posted on November 26, 2020by admin

This short note shows how to remove all Docker images and containers. Use these commands with caution as they force the removal of all the Docker images and containers including the running ones.

Read More
No comments yet
  • Blog

Alpine: Install Package

Posted on November 16, 2020November 18, 2020by admin

A minimal Docker image based on Alpine Linux has only 5 MB in size, but a lot of packages common for Linux distributions are not installed by default. In this short note i will show how to install a package in Alpine container from the command line using the apk (Alpine package manager). I will […]

Read More
1 Comment
  • Blog

Docker: Login Command – Registry Login & Logout

Posted on June 10, 2020June 10, 2020by admin

To start using a private Docker Registry a user usually should run the docker login command and set a username and password that will be cached locally. If a user tries to docker pull or docker push an image from/to a private Docker Registry, without having run the docker login command in advance, he may […]

Read More
No comments yet
  • Blog

Docker: Run Multiple Commands in Container

Posted on June 8, 2020by admin

Multiple commands can be executed in a running Docker container using the docker exec command. If the Docker container is stopped, before running the docker exec command it should be started using the docker run command. In this short note i will show the examples of how to execute multiple commands in a Docker container.

Read More
No comments yet
  • Blog

Docker: Run Command in Container – Exec Example

Posted on June 8, 2020June 8, 2020by admin

The docker exec command serves for executing commands in a running container. If the Docker container is stopped, before running the docker exec command it should be started using the docker run command. In this short note i will show the examples of how to execute commands Docker containers.

Read More
No comments yet

Posts navigation

Older posts

Online Tools

  • Base64 Decode
  • Base64 Encode

Tags

access-control anonymity ansible apache archive arduino artifactory aws bash boot cmd command-line curl dns docker encryption git gitlab java jenkins kubernetes linux macos mail mongodb mysql network openssl password pdf php powershell prometheus python raspberry pi ssh sublime text telegram telnet text-processing tor tsm windows wordpress yum
  • Telegram
  • Twitter
  • RSS
Privacy
Copyright © 2011-2022 | www.ShellHacks.com