码迷,mamicode.com
首页 > 其他好文 > 详细

如何制作Base Image

时间:2019-01-12 17:59:20      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:uil   技术分享   src   构建   http   ext   printf   https   ati   

sudo gpasswd -a vagrant docker
重启docker 进程
sudo service docker restart
docker pull hello-world
这hello-world也是个base image ,很小
运行这个容器
docker run hello-world
mkdir hello-world
cd hello-world
vim hello.c

#include<stdio.h>

int main()
{
printf("hello docker\n");
}
编译c程序要先安装
yum install gcc
yum install glibc-static
gcc -static hello.c -o hello
./hello
vim Dockerfile
FROM scratch
ADD hello /
CMD ["/hello"]
docker build -t skinglzw/hello-world . 构建bese image 完成
技术分享图片

如何制作Base Image

标签:uil   技术分享   src   构建   http   ext   printf   https   ati   

原文地址:http://blog.51cto.com/skinglzw/2342005

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!