Skip to content

Alappin/golang-docker-minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Example on building a minimal GO Docker container

LINUX

  1. Copy Certificate to the working dir
cp /etc/ssl/certs/ca-certificates.crt .
  1. Build the application with as a statically linked binary:
CGO_ENABLED=0 GOOS=linux go build -a --ldflags="-s" --installsuffix cgo -o main
  1. Build the Docker container
docker build -t YOURNAME/APPNAME -f ./Dockerfile .
  1. Run it docker run -d -p 3000:3000 YOURNAME/APPNAME

About

Building a GO application using SCRATCH

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages