These are steps to complete the two exercises in Docker that I demonstrated yesterday, a recording of which is available here on YouTube.
Steps:
- Navigate to the Docker Playground.
- Add a new instance of Docker in the playground.
- Analyze the C programme code given in this repository.
- Clone the repository inside Docker Playground and open the folder.
git clone https://github.com/paramsiddharth/docker-calcsum-example.git cd docker-calcsum-example
- Build the image using Docker.
docker build -t c_code .
- Check the newly-created image using
docker images
- Execute the image in a temporary interactive container.
docker run --rm -it c_code
- Delete the image.
docker rmi c_code
- Exit Docker Playground.
Steps:
- Navigate to the Docker Playground.
- Add a new instance of Docker in the playground.
- Have an overview of this repository.
- Clone the repository inside Docker Playground and open the folder.
git clone https://github.com/paramsiddharth/docker-static-website-lighttpd.git cd docker-static-website-lighttpd
- Build the image using Docker.
docker build -t static_website .
- Check the newly-created image using
docker images
- Execute the image in a temporary container, mapping local port 3000 to port 80 of the container.
docker run --rm -p 3000:80 static_website
- Open port 3000 in the playground to visit the website launched.
- Press
Ctrl+C
orCmd+C
while in the playgroud terminal to stop the container. - Delete the image.
docker rmi static_website
- Exit Docker Playground.