Alpine: Docker commands

15 篇文章 0 订阅
9 篇文章 0 订阅

Alpine: Docker commands


// update repositories
vi /etc/apk/repositories
// add mirrors below
#/media/cdrom/apks
http://mirrors.tuna.tsinghua.edu.cn/alpine/v3.8/main
http://mirrors.tuna.tsinghua.edu.cn/alpine/v3.8/community
# add by dijk
http://mirrors.aliyun.com/alpine/v3.8/main/
http://mirrors.aliyun.com/alpine/v3.8/community/
http://mirrors.ustc.edu.cn/alpine/v3.8/main
http://mirrors.ustc.edu.cn/alpine/v3.8/community
#http://dl-cdn.alpinelinux.org/alpine/v3.8/main
#http://dl-cdn.alpinelinux.org/alpine/v3.8/community

apk update

// install docker
apk add docker
// delete docker
apk del docker

// stop/start/restart docker
$ service docker stop | start | restart

// set auto start
$ rc-update add docker boot #增加一个服务
$ rc-update del docker boot #删除一个服务

// test docker
# docker run hello-world

// see images
# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              4ab4c602aa5e        3 months ago        1.84kB

// get alpine 3.8 image
# docker pull alpine:3.8
3.8: Pulling from library/alpine
4fe2ade4980c: Pull complete
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Downloaded newer image for alpine:3.8

// see images again
# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              3.8                 196d12cf6ab1        2 months ago        4.41MB
hello-world         latest              4ab4c602aa5e        3 months ago        1.84kB

// create data volume container
# docker run -it --name=workspace -v /workspace:/workspace:Z alpine:3.8

// install git
# apk add git
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值