Docker - Linux Container (Ubuntu, Redhat, )

Card Puncher Data Processing

About

Linux container type

Example Running Ubuntu with Docker

  • Run it
## docker run -it $(CONTAINER_NAME) bash
$ docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu

6bbedd9b76a4: Pull complete
fc19d60a83f1: Pull complete
de413bb911fd: Pull complete
2879a7ad3144: Pull complete
668604fde02e: Pull complete
Digest: sha256:2d44ae143feeb36f4c898d32ed2ab2dffeb3a573d2d8928646dfc9cb7deb1315
Status: Downloaded newer image for ubuntu:latest

  • Test it
echo $SHELL
/bin/bash

Management

Base

base image

Distribution

Ubuntu

  • Update it because the ubuntu image is minimal
apt-get update
  • And install what you want
apt-get install wget
apt-get install vim

Redhat

Redhat use its own registry: Redhat container catalog.

Get base Image from the RedHat Registry with docker:

# Minimu Size
# https://access.redhat.com/containers/?tab=overview&platform=docker#/registry.access.redhat.com/rhel7-atomic
docker pull registry.access.redhat.com/rhel7-atomic
# Full
# https://access.redhat.com/containers/?tab=overview&platform=docker#/registry.access.redhat.com/rhel7.5
docker pull registry.access.redhat.com/rhel7.5

Then: Example starting Redhat with mounting the actual current directory to /wd with the cmder console

SOURCE_MOUNT_POINT=$(cygpath -u $(readlink -f .))
docker run  \
    --mount type=bind,source=/$SOURCE_MOUNT_POINT,target=/wd \
    -rm \
    -it \
    registry.access.redhat.com/rhel7 \
    bash

Then:

yum update>
yum install wget
yum install vim





Discover More
Card Puncher Data Processing
Docker - Command (CMD)

cmd defines a command that should be run inside the container. You can explicitly pass the cmd as argument to the docker cli. Example: the image is ubuntu the entrypoint is the default /bin/sh...
Docker For Windows Switch Container Type
Docker - Containers

in Docker. A container is a running instance of an image. Docker containers only run as long as the command you specify is active. A container ID uniquely identifies a container. A container...
Docker Run Container Explainer
Docker - Getting Started

install docker To generate this message, Docker took the following steps: 1- The Docker client contacted the Docker daemon. 2- The Docker daemon pulled the “hello-world” image from the Docker...
Card Puncher Data Processing
Docker - Image

This page is the container image in Docker. OCI is the standardized container format used by Docker Docker stores downloaded images on the Docker host at the Docker Root Dir location where:...
Card Puncher Data Processing
What is the Entrypoint (Main) in Docker?

This page is the main entry in Docker. The entry point script is the script called when creating a container from an image with the docker run command When the entry point program exits, the VM is stopped...



Share this page:
Follow us:
Task Runner