嘗試本身創建以alpine 爲基礎的docker基礎鏡像和組件鏡像

安裝ubuntu14.04linux

而後docker

#獲取root權限ubuntu

sudo sucentos

#安裝dockerfetch

apt-get install dockerui

#準備基礎鏡像url

docker pull alpinecentos7

docker run -a stdin -a stdout -i -t  alpine /bin/shspa

執行進入了容器命令行

/#

exit 推出容器內部

docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
573010aaf72d        alpine:latest       "/bin/sh"           4 minutes ago       Exited (1) 38 seconds ago                       sad_cori

 

docker attach 573010aaf72d
FATA[0000] You cannot attach to a stopped container, start it first

推出run交互方式後容器中止了 再打開

docker start  573010aaf72d

docker attach 573010aaf72d

而後多按幾下回車 就會進入

/#

##到這裏 就至關於這個容器已經完成了  以後你只須要例以下面 這條命令 安裝 命令行多點下載命令axel

apk --update add axel

不過呢 國內連apk的源 軟件包實在不是很好 常常斷線  實際上使用看來要等點時間 估計docker官方會改爲使用alpine了   基本上除了axel那麼小的軟件包之外 都會出錯 呵呵

 

補充:2016年11月21日,在公司測的 已經能夠在alpine裏下載安裝axel 而且正確運行了  有一點要注意  alpine的apk 沒有下載進度條  哈哈哈 出錯只會有超時報錯 哈

docker run -d -it alpine sh

docker exec -it  7a2 sh (7a2 是上句生成的容器的id前三位)

[root@localhost ~]# docker exec -it 7a2 sh
/ # apk --update add axel
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/1) Installing axel (2.4-r1)
Executing busybox-1.24.2-r11.trigger
OK: 5 MiB in 12 packages
/ # axel
Usage: axel [options] url1 [url2] [url...]

--max-speed=x -s x Specify maximum speed (bytes per second)
--num-connections=x -n x Specify maximum number of connections
--output=f -o f Specify local output file
--search[=x] -S [x] Search for mirrors and download from x servers
--header=x -H x Add header string
--user-agent=x -U x Set user agent
--no-proxy -N Just don't use any proxy server
--quiet -q Leave stdout alone
--verbose -v More status information
--alternate -a Alternate progress indicator
--help -h This information
--version -V Version information

Visit http://axel.alioth.debian.org/ to report bugs
/ #

 

呵呵  已經能夠用了  感受有但願拋開centos7的那個2百mb的大小了

 

。。。。。後來嘗試下另一個包  就不行。。。唉   坑爹的apline的包管理。。。。

相關文章
相關標籤/搜索