title | slug | weight |
---|---|---|
Building a Base Image |
Building-a-Base-Image |
6 |
#include<stdio.h>
int main()
{
printf("dockerworkshop");
}
gcc -o hello hello.c
✗ ./hello
dockerworkshop%
FROM scratch
ADD hello /
CMD ["/hello"]
Dockerfile git:(main) ✗ docker build -t sangam14/hello-scratch -f dockerfile.hello .
[+] Building 0.1s (5/5) FINISHED
=> [internal] load build definition from dockerfile.hello 0.0s
=> => transferring dockerfile: 87B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 33.47kB 0.0s
=> [1/1] ADD hello / 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:769934a6858c0910a3682e966da6c8d9c15b0324307b092eb77258a9a08879ce 0.0s
=> => naming to docker.io/sangam14/hello-scratch
docker run sangam14/hello-scratch
dockerworkshop