0% found this document useful (0 votes)
8 views

Lab4 Dockerfile

The document describes building Docker images from scratch and from existing projects. It details cloning code from GitHub, writing Dockerfiles, building images, testing images, and pushing images to a Docker registry.

Uploaded by

Aymen CHABBOUH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lab4 Dockerfile

The document describes building Docker images from scratch and from existing projects. It details cloning code from GitHub, writing Dockerfiles, building images, testing images, and pushing images to a Docker registry.

Uploaded by

Aymen CHABBOUH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

LPI DevOps Tools Engineer Labs

Lab 4 – Dockerfile
Build docker image
Build image from scratch
1. Write a C program that displays "Hello DevOps !! ".

2. Compile the program with a static library.

3. Write a dockerfile file with the following content:


FROM scratch
COPY app app
CMD ["./app"]

4. Build image myapp:1.0

1/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

5. Create new container with builded image.

Build mediawiki images


6. Clone the following mediawiki project from the remote repository :
https://github.com/brahimhamdi/wikimedia
Change to the wikimedia folder

2/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

7. Describe the Dockerfile in the wiki_app folder.

Based on this Dockerfile, build wiki_app:1.0 image and then test it.

8. Describe the Dockerfile in the wiki_db folder.

3/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

Based on this Dockerfile, build wiki_db:1.0 image and then test it.

9. Install the application.

Build dockercoins images


10. Clone the following dockercoins project from the remote repository :
https://github.com/brahimhamdi/dockercoins

4/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

11. Describe all Dockerfiles in the project.

5/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

12. Based on Dockerfiles, build all images of this projects. And then test them.

6/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

7/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

Push docker images to remote registry


13. Create an account in hub.docker.com/ registry.

14. Tags all images with your GitHub username and push them to dockerhub registry.

8/9 Brahim HAMDI


LPI DevOps Tools Engineer Labs

15. Delete locally all pushed images.

Test pushed images.

9/9 Brahim HAMDI

You might also like