docker_practice/cases/os/alpine.md

63 lines
3.1 KiB
Go
Raw Normal View History

2017-05-24 11:22:23 +08:00
## Alpine
###
![Apline Linux ](_images/alpinelinux-logo.png)
`Alpine` `Linux` `Linux` `Alpine` `musl libc` `busybox` `busybox` `Alpine` `apk` `https://pkgs.alpinelinux.org/packages` `apk`
`Alpine` 广 `Linux`/`Linux``Alpine` /
`Alpine` Docker Alpine Linux `Docker` 5 MB Ubuntu 200 MB `docker-alpine`
Docker 使 `Alpine` `Ubuntu` 便
2017-12-01 23:23:26 +08:00
```bash
2017-05-24 11:22:23 +08:00
REPOSITORY TAG IMAGE ID VIRTUAL SIZE
alpine latest 4e38e38c8ce0 4.799 MB
debian latest 4d6ce913b130 84.98 MB
ubuntu latest b39b81afc8ca 188.3 MB
centos latest 8efe422e6104 210 MB
```
### 使
使 `docker run` `Alpine` Linux
2017-12-01 23:23:26 +08:00
```bash
2017-05-24 11:22:23 +08:00
$ docker run alpine echo '123'
123
```
### `Alpine`
Docker Alpine
* ubuntu/debian -> alpine
* python:2.7 -> python:2.7-alpine
* ruby:2.3 -> ruby:2.3-alpine
使 `Alpine` `Ubuntu` apk apt
2017-12-01 23:23:26 +08:00
```bash
2017-05-24 11:22:23 +08:00
$ apk add --no-cache <package>
```
`Alpine` `https://pkgs.alpinelinux.org/packages` 使
2017-12-01 23:23:26 +08:00
```bash
2017-05-24 11:22:23 +08:00
$ echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
$ apk --update add --no-cache <package>
```
###
2019-01-06 10:15:13 +08:00
* `Alpine` https://www.alpinelinux.org/
2017-12-01 23:23:26 +08:00
* `Alpine` https://github.com/alpinelinux
* `Alpine` https://hub.docker.com/_/alpine/
* `Alpine` https://github.com/gliderlabs/docker-alpine