hands-on lab

Containerizing Go Applications with Docker: Basic

Difficulty: Beginner
Duration: Up to 1 hour
Students: 276
Rating: 4.4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

This lab is based around the following scenario. You are creating a small command line utility for yourself using the Go programming language. After creating it you decide you would like to contribute it to the open source community, with Docker being an option. You will create a Docker image for your newly programmed command line utility. This lab will provide you with a basic understanding of containerizing simple programs written in Go.

Learning Objectives

Upon completion of this lab you will be able to:

  • Create a command line utility using the Go programming language
  • Write a Dockefile with instructions on how to build the Docker image
  • Build the Docker image

Intended Audience

This lab is intended for:

  • Developers, especially those starting out with Go
  • Anyone beginning to leverage containers

Prerequisites

You should possess:

  • Basic understanding of the Go programming language syntax
  • Understanding of the Linux command line
  • Conceptual understanding of Docker

The following content is sufficient to fulfill these prerequisites:

Covered topics

Lab steps

Connecting to the Go Development Environment
Creating the my-echo Program
Writing a Dockerfile
Building the Image
Running a Container using the Image