O'Reilly logo

Microservice Patterns and Best Practices by Vinicius Feitosa Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required