Creating Dockerfile

First, let's create the file Dockerfile in UsersService itself. This file is responsible for assembling the image of our container and compiling the application.

The FROM policy is responsible for indicating which operating system will be used for our application. In this case, we will use a golang:latest, which is an Ubuntu with Go properly installed.

# APP Dockerfile # For more control, you can copy and build manually from golang:latest.

The LABEL policy serves to tell you what the name of our application and version is:

LABEL Name=userservice Version=0.0.1

With the RUN policy, we are creating the default workspace directories of Go. These directories are src, pkg, and bin. To create them, use the mkdir -p command shown ...

Get Microservice Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.