Sometimes it is required to check the current version of Java installed. By Java version i mean the version of Java Development Kit (JDK) or the version of Java Runtime Environment (JRE). As JDK and JRE are different components of Java (JDK is used to compile Java programs while JRE is used to run them), […]
Sometimes it is required to run an application as a different user. For example, you may want to run an elevated command prompt to execute some commands with administrative privileges. In Windows, an executable file can be run as a different user from the File Explorer or using the command line.
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 […]
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.
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.
Adding labels to Docker images is a good practice as this custom metadata permits to organize images by environments, record build information and is very helpful in automation. This guide will show you 2 ways of how to add custom metadata to Docker images.
Docker image is built up from a series of layers that represent instructions in the image’s Dockerfile. Sometimes it may be necessary to show an image layers, their sizes and the instructions they have been created of. In this note i will show how to list all layers a Docker image is composed of, show […]
The good practice is to tag Docker images with useful tags, e.g. version, intended destination (prod or staging), stability or any other information that is useful when deploying the application in different environments. In this note i will show how to tag Docker images with one or multiple tags during a build. Also i will […]
A minimal Docker image based on Alpine Linux has only 5 MB in size, but a lot of tools common for Linux distributions (e.g. curl) are not installed by default. In this short note i will show how to install curl in Alpine container from the command line. I will also show how to build […]
A docker run command is one of the basic commands in a Docker universe as it is used to start containers from Docker images. In this short note i will show how to start a Docker container in a foreground, in a background or with an interactive shell session of bash or sh from the […]