Introdução
Instalação
Exemplo de Dockerfile
# DockerfileFROM golang:1.15WORKDIR /go/srcENV PATH="/go/bin:${PATH}"ENV GO111MODULE=onENV CGO_ENABLED=1RUN apt-get update && \apt-get install build-essential protobuf-compiler librdkafka-dev -y && \go get google.golang.org/grpc/cmd/protoc-gen-go-grpc && \go get google.golang.org/protobuf/cmd/protoc-gen-go && \go get github.com/spf13/cobra/cobra && \wget https://github.com/ktr0731/evans/releases/download/0.9.1/evans_linux_amd64.tar.gz && \tar -xzvf evans_linux_amd64.tar.gz && \mv evans ../bin && rm -f evans_linux_amd64.tar.gzCMD ["tail", "-f", "/dev/null"]
Exemplo de Docker Compose
# docker-compose.ymlversion: "3"services:app:build: .volumes:- .:/go/src/
Iniciando na máquina do Docker
# Executar as instânciasdocker-compose up -d# Acessar a máquinadocker exec -it NOMEDAAPLICACAO bash# Iniciar as instâncias do Gogo mod init github.com/codeedu/imersao/codepix-go