Docker 部署 Alpine Linux

Docker Alpine Linux About 510 words

搜索镜像

docker search alpine

拉取镜像

版本号可以去官网查看:https://hub.docker.com/_/alpine

docker pull alpine:3.16.0

创建容器

-itdalpine类似与CentOS等操作系统,如果没有交互式的后台进程保持着,退出交互式命令后,容器也就不再运行了。所以必须要加上-it参数,启动一个交互式命令行,保证容器内有后台进程一直运行。

/etc/localtime:/etc/localtime:ro:容器内部的时间格式化保持和宿主机一致。

docker run -itd \
--name alpine \
-v /etc/localtime:/etc/localtime:ro \
alpine:3.16.0

进入容器

注意:alpine用的是sh,不是bash

docker exec -it alpine sh

相关 issue

https://github.com/alpinelinux/docker-alpine/issues

开源地址

https://github.com/alpinelinux/docker-alpine

Views: 1,032 · Posted: 2022-12-14

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh