Week 13 - Systems

App Development lifecycle

Continuous integration (CI)

Continuous Delivery (CD)

Packaging and Docker

Docker setup

Building an API server

Deployments

Intro to Cloud

Using local LLMs

Appendix 1 yaml syntax

Appendix 2 Docker commands

Practice

Assignment

Core program

Installing Docker

Download and Install docker desktop from https://www.docker.com/

Once installed, you will be able to launch the Docker desktop and view a nice UI.

Docker Desktop dashboard with a few containers running. Note the green “Engine is running” message on the bottom left.

Docker Desktop dashboard with a few containers running. Note the green “Engine is running” message on the bottom left.

The Docker installation comes with multiple components:

Verify your installation

  1. Open the Docker Desktop application and look at the bottom-left corner. You should see the message “Engine running”, which indicates that the Docker engine is running.

  2. Run the following command

    docker version
    

    You should be able to see the docker version and no error message at the bottom.

<aside> ❗

While it is running, Docker can use a lot of your computer’s resources, especially memory. Stop it when you are not using it. Watch out: Docker runs in the background even if the Docker Desktop app is closed.

</aside>

Docker hub

After installing Docker, you already have access to thousands of ready-to-use container images through Docker Hub Docker Hub is a public registry - think of it as the npm of containers. Just like npm hosts JavaScript packages that anyone can install with npm install, Docker Hub hosts container images that anyone can download with docker pull or docker run. Companies and open-source projects publish their images there: nodepostgresnginxubuntu, and thousands more. You can browse the website, search for images, read their documentation, and see how popular they are. When you run a command like docker run postgres, Docker checks if the image exists on your machine. If it doesn't, it automatically downloads it from Docker Hub.

Running your first container

Open the terminal and enter the following command

docker run -p 8080:80 --name welcome docker/welcome-to-docker

Wait a few minutes while Docker pulls the latest image from the internet and starts the container.

Open a new browser window and go to http://localhost:8080. You should see a congratulations message:

image.png

Press CTRL+C to stop the container.

<aside> ⌨️

Hands on: Open Docker desktop UI, look at the container tabs:

  1. Re-run the ‘welcome’ container.
  2. Stop and delete the ‘welcome’ container
  3. Go to Images and remove the ‘welcome-to-docker’ container </aside>

<aside> 🎉

Well done! Docker is now successfully installed and you run your first container

</aside>

Recap and Deeper dive (50 mins video)

Watch the following video to recap the concepts we covered so far and shows how to use the docker CLI with additional commands.

<aside> 💭

Watch the video and stop at the “Dockerfile” chapter (49:10). Once again, watching until the end is not required, but feel free to continue if you are interested

</aside>

https://www.youtube.com/watch?v=pg19Z8LL06w

For a list of handy docker commands, check out Appendix 2 Docker commands


The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with ❤️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.