1.Dockerfile
FROM scratch
ADD hello /
CMD ["/hello"]
2.hello.c
#include<stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
3.构建image
docker build -t xingfeng/hello-world .
docker run xingfeng/hello-world
1.Dockerfile
FROM scratch
ADD hello /
CMD ["/hello"]
2.hello.c
#include<stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
3.构建image
docker build -t xingfeng/hello-world .
docker run xingfeng/hello-world
本文标题:DIY一个基础镜像
本文链接:https://www.haomeiwen.com/subject/oarbthtx.html
网友评论