Docker

From wiki
Revision as of 20:15, 20 July 2025 by Hdridder (talk | contribs) (Created page with "Category:Linux/Unix Docker is used to create containers. In a container system resources are separated from each other e.g. to create a development environment where the developer can experiment freely without the risk of jeopardizing the host system. A dockerfile defines what will be in the docker image, running the image will create a container. ;Installation: apt install docker.io apt install docker-buildx ;This creates a working container :Dockerfile in /etc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Docker is used to create containers. In a container system resources are separated from each other e.g. to create a development environment where the developer can experiment freely without the risk of jeopardizing the host system.

A dockerfile defines what will be in the docker image, running the image will create a container.

Installation
apt install docker.io
apt install docker-buildx
This creates a working container
Dockerfile in /etc/docker
FROM ubuntu
LABEL name="Hans de Ridder"
RUN apt-get update
CMD ["bash", "-i"]
docker build /etc/docker
This build the image
docker image ls
List all existing images
docker run -it <image ID>
Create the container and open a bash prompt in it. When leaving the shell the container is closed