Build the app with Docker

Throughout this guide, an example application written in Go is used to illustrate how the build features work. You don’t need to know the Go programming language to follow this guide.

The starting resources for this guide include a simple Go project and a Dockerfile. From this starting point, the guide illustrates way that how you build the application with Docker.

Let’s code!

Environment setup

To follow this guide:

  1. Install Docker Desktop or Docker Engine
  2. Clone or create a new repository from the application example on GitHub(I’d love your stars ??????)

The application

The example project for this guide is a client-server application for translating messages to a fictional language.

Here’s an overview of the files included in the project:

.
????????? Dockerfile
????????? cmd
???   ????????? client
???   ???   ????????? main.go
???   ???   ????????? request.go
???   ???   ????????? ui.go
???   ????????? server
???       ????????? main.go
???       ????????? translate.go
????????? go.mod
????????? go.sum

The cmd/ directory contains the code for the two application components: client and server. The client is a user interface for writing, sending, and receiving messages. The server receives messages from clients, translates them, and sends them back to the client.

Visit Now

Tags: App Docker