#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 完成
原文:http://blog.51cto.com/skinglzw/2342005