bademux / golang-dep

🐳A multi-architecture build image for building Go projects with Dep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang image with Dep

A multi-platform image for golang dep tool.

Build Status Platform Platform Platform

How to Build

Assuming that you have Docker up and running, run the following commands:

git clone https://github.com/moikot/golang-dep
cd golang-dep
docker build -t goland-dep .

How to use

This image intended to be used as a build image for building your Golang applications using Docker. Here is an example of a Docker file for building one.

FROM moikot/golang-dep as build-env

ARG APP_FOLDER=/go/src/github.com/foo/bar/

ADD . ${APP_FOLDER}
WORKDIR ${APP_FOLDER}

RUN dep ensure -vendor-only

# Compile independent executable
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /bin/main .

FROM scratch

COPY --from=build-env /bin/main /

ENTRYPOINT ["/main"]

About

🐳A multi-architecture build image for building Go projects with Dep

License:MIT License


Languages

Language:Shell 88.8%Language:Dockerfile 11.2%