Wednesday, March 6, 2019

Dockerfile

this blog posts shows a simple hello world Dockerfile example.

ubuntu:~/app/myapp1$ cat Dockerfile
FROM alpine
CMD ["echo", hello world!"]

ubuntu:~/app/myapp1$ sudo docker build .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM alpine
latest: Pulling from library/alpine
6c40cc604d8e: Pull complete
Digest: sha256:b3dbf31b77fd99d9c08f780ce6f5282aba076d70a513a8be859d8d3a4d0c92b8
Status: Downloaded newer image for alpine:latest
 ---> caf27325b298
Step 2/2 : CMD ["echo hello world!"]
 ---> Running in 6b813f4405dd
Removing intermediate container 6b813f4405dd
 ---> 6aaaa0ac6697
Successfully built 6aaaa0ac6697

ubuntu:~/app/myapp1$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              30dcbba17c50        58 seconds ago      5.53MB
alpine              latest              caf27325b298        5 weeks ago         5.53MB
nginx               1.10.0              16666ff3a57f        2 years ago         183MB
nginx               1.9.3               ea4b88a656c9        3 years ago         133MB
prabhan_world@ubuntu:~/app/myapp1$ sudo docker run --name test 30dcbba17c50
hello world!

No comments:

Post a Comment

Not able to login to a server from putty using ppk file

 If you are not able to login to a Linux server from putty using a ppk file, you can regenerate the file using the below options. Open putty...