标签:registry 技术分享 min end nop printf 执行文件 static print
#include<stdio.h>
int main()
{
printf("hello docker\n");
}
gcc -static hello.c -o hello
FROM scratch
ADD hello /
CMD ["/hello"]
??命令:
docker image build <==> docker build
docker build -t staryjie/hello-docker .
Sending build context to Docker daemon 868.9kB
Step 1/3 : FROM scratch
--->
Step 2/3 : ADD hello /
---> d6f5edefd7fa
Step 3/3 : CMD ["/hello"]
---> Running in e1db264875b9
Removing intermediate container e1db264875b9
---> 09be7d865fab
Successfully built 09be7d865fab
Successfully tagged staryjie/hello-docker:latest
??命令:
docker history
docker history staryjie/hello-docker:latest
IMAGE CREATED CREATED BY SIZE COMMENT
09be7d865fab 4 minutes ago /bin/sh -c #(nop) CMD ["/hello"] 0B
d6f5edefd7fa 4 minutes ago /bin/sh -c #(nop) ADD file:e98243ff005d26728… 865kB
标签:registry 技术分享 min end nop printf 执行文件 static print
原文地址:https://www.cnblogs.com/jie-fang/p/10279669.html