Browse Source

Updated docker recipe using a debian-based system

Made some changes to the build command and the docker build command
Aaron Torres 2 years ago
parent
commit
0cd52fff89
1 changed files with 3 additions and 3 deletions
  1. 3 3
      chapter10/docker/setup.sh

+ 3 - 3
chapter10/docker/setup.sh

@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 pushd example
-env GOOS=linux go build -ldflags "-X main.version=1.0 -X main.builddate=$(date +%s)"
+env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=1.0 -X main.builddate=$(date +%s)"
 popd
-docker build . -t example
-docker run -d -p 8000:8000 example 
+docker build -t example .
+docker run -d -p 8000:8000 example