How to Push Your Golang App to Docker Hub | Github Actions and Dockerfile tutorial

Опубликовано: 11 Апрель 2022
на канале: Learn Fast Make Things
3k
84

Learn how to write a Dockerfile for a Golang (Go) app, build a Docker container, and push it up to Docker Hub using Github Actions!

This video covers:
1. Creating a multi-stage Dockerfile for a Golang app.
2. Running your container as a non-root user for security.
3. Installing Docker Desktop
3. Building and running your container locally.
4. Adding environment variables to a docker container using a .env file
5. Creating a Docker Hub repo
6. Creating a Docker Hub Access token
7. Using Github actions to push your container image to Docker Hub automatically

Links:

Repo for this project:
"Follow along" branch:
Docker hub repo for this tutorial:
Docker desktop:
Github Actions:
Github actions example:


00:00 - Intro
00:12 - Create the Dockerfile
06:24 - Install Docker Desktop
07:27 - Build the Image
08:47 - Passing environment variables to the container
10:22 - Debugging and lessons learned
12:05 - Run the local container
12:14 - Create a docker hub repo
12:57 - Create a docker hub token
13:24 - Create the Github Action file
14:26 - Setting up the secrets Github
15:08 - Setup docker hub tagging with Github actions
17:25 - Push the code - trigger the Github action
18:54 - Run the docker hub version of the container


Смотрите видео How to Push Your Golang App to Docker Hub | Github Actions and Dockerfile tutorial онлайн без регистрации, длительностью 19 минут 24 секунд в хорошем hd качестве. Это видео добавил пользователь Learn Fast Make Things 11 Апрель 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3 тысяч раз и оно понравилось 8 людям.