/docker-base

Primary LanguageShellMIT LicenseMIT

dclong/base @DockerHub | @GitHub

Base Docker images.

Prerequisite

You need to install Docker before you use this Docker image.

Branches, Linux Distributions and Docker Images

Branch Linux Docker
main Ubuntu 20.04 dclong/base
dev Ubuntu 20.04 dclong/base:next
21.10 Ubuntu 21.10 dclong/base:21.10
debian Debian Testing dclong/base:debian
centos7.6 CentOS 7.6 dclong/base:centos7.6

Usage in Linux/Unix

Please refer to the Section Usage of the post My Docker Images for detailed instruction on how to use the Docker image.

The following command starts a container and mounts the current working directory and /home on the host machine to /workdir and /home_host in the container respectively.

docker run -it --init \
    --hostname ubuntu_b \
    --log-opt max-size=50m \
    -e DOCKER_USER=$(id -un) \
    -e DOCKER_USER_ID=$(id -u) \
    -e DOCKER_PASSWORD=$(id -un) \
    -e DOCKER_GROUP_ID=$(id -g) \
    -v $(pwd):/workdir \
    -v $(dirname $HOME):/home_host \
    dclong/base /scripts/sys/init.sh -u -e /bin/bash

The following command (only works on Linux) does the same as the above one except that it limits the use of CPU and memory.

docker run -it --init \
    --hostname ubuntu_b \
    --log-opt max-size=50m \
    --memory=$(($(head -n 1 /proc/meminfo | awk '{print $2}') * 4 / 5))k \
    --cpus=$(($(nproc) - 1)) \
    -e DOCKER_USER=$(id -un) \
    -e DOCKER_USER_ID=$(id -u) \
    -e DOCKER_PASSWORD=$(id -un) \
    -e DOCKER_GROUP_ID=$(id -g) \
    -v $(pwd):/workdir \
    -v $(dirname $HOME):/home_host \
    dclong/base /scripts/sys/init.sh -u -e /bin/bash

Log Information

Detailed Information

Known Issues

About the Author