自制的ubuntu;20.04基础镜像,使用工具debootstrap。
在ubuntu系统下,安装debootstrap并打包:
apt -y install debootstrap
debootstrap focal focal
tar -C focal/ -c . | docker import - demo
然后编写Dockerfile,添加了+8时区,安装常用工具,内容如下:
FROM demo
ENV container docker
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN apt update && apt -y install --no-install-recommends vim git wget curl net-tools && rm -rf /var/lib/apt/lists/*
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD ["/bin/bash"]
开始构建:
docker build -t ahkworld/ubuntu .
完成构建,大小为464MB,可接着在此之上构建其他镜像,而不是直接运行
运行命令:
docker run -itd --name=ubuntu ahkworld/ubuntu
进入容器:
docker exec -it ubuntu bash
由于使用原版镜像,apt源并不齐全,请自行添加
Content type
Image
Digest
Size
200.5 MB
Last updated
about 4 years ago
docker pull ahkworld/ubuntu