Containerizing Go Applications with Docker: Advanced

Developed with
Calculated Systems

Lab Steps

lock
Connecting to the Go Development Environment
lock
Working with Go Modules
lock
Building and Testing the Greeter Server
lock
Containerizing greeter-server with Docker
lock
Refactoring Docker Builds

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyIntermediate
Time Limit1h
Students58
Ratings
4.5/5
starstarstarstarstar-half

Description

In the previous lab, you created a simple command line utility and were able to containerize it with Docker. This lab will cover advanced topics of containerizing Go applications. In this lab, you'll containerize a simple web server application. This web server uses Go modules to handle dependencies and you'll learn how to manage them when building a Docker image. You'll also learn about the Docker multi-stage build pattern, and how to expose ports when running a Docker image.

Learning Objectives

Upon completion of this lab you will be able to:

  • Add third party libraries to Go source code using Go modules
  • Write a Dockerfile capable of managing third-party libraries in a Go application
  • Build the Docker image
  • Refactor the Dockerfile to use a multi-stage build architecture, and leverage Docker build caching

Intended Audience

This lab is intended for:

  • Developers, especially those working with Go
  • Anyone leveraging containers

Prerequisites

You should possess:

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

The following content is sufficient to fulfill these prerequisites:

Updates

August 17th, 2021 - Addressed an issue and clarified some instructions

About the Author
Students9293
Labs31
Courses13
Learning paths21

Calculated Systems was founded by experts in Hadoop, Google Cloud and AWS. Calculated Systems enables code-free capture, mapping and transformation of data in the cloud based on Apache NiFi, an open source project originally developed within the NSA. Calculated Systems accelerates time to market for new innovations while maintaining data integrity.  With cloud automation tools, deep industry expertise, and experience productionalizing workloads development cycles are cut down to a fraction of their normal time. The ability to quickly develop large scale data ingestion and processing  decreases the risk companies face in long development cycles. Calculated Systems is one of the industry leaders in Big Data transformation and education of these complex technologies.

Covered Topics