Docker上手Day1(alpine-bash)

  • 新建一个DockerFile,内容如下
1
2
3
4
5
6
7
8
FROM alpine:latest

RUN  sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk upgrade  && \
apk add --no-cache bash bash-doc bash-completion

CMD ["/bin/bash"]

生成这个镜像文件

1
buildah bud -t alpine-bash:latest .

执行这个镜像,--rm将在退出时删除。

1
podman run --rm -it alpine-bash