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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.