Skip to content

docker image with golang runtime and protobuff installed

License

Notifications You must be signed in to change notification settings

roderm/go-protoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-protoc

Dockerimage with golang compiler and protoc to build binaries form gocode and proto-buf files.

Usage

Example Dockerfile in $GOPATH:

FROM roderm/go-protoc:latest as builder
WORKDIR $GOPATH/src/github.com/roderm/go-app
COPY ./* ./*
## get packages
RUN go get 
## generate protocs
RUN find ./ -type f -name *.proto -exec \
     protoc \
     --proto_path=${GOPATH}/src:. \
     --go_out=${GOPATH}/src \
     {} \;

## build it
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /out/go-app -ldflags '-w -s' main.go

## Build a new Image from scratch
FROM scratch as final
COPY --from=builder /out/go-app /app/run
ENTRYPOINT [/app/run]

About

docker image with golang runtime and protobuff installed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published