File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Copyright (c) 2018, Juniper Networks, Inc.
22# All rights reserved.
33
4- FROM alpine:3.7
5- RUN apk add --no-cache ethtool
6- RUN apk add --no-cache --virtual build-dependencies git go musl-dev \
7- && mkdir -p /root/go/src/github.com/nileshsimaria \
8- && cd /root/go/src/github.com/nileshsimaria \
9- && git clone https://github.com/nileshsimaria/jtimon.git \
10- && cd jtimon && go build && strip jtimon && mv jtimon /usr/local/bin \
11- && cd / \
12- && rm -fr /root/go \
13- && apk del build-dependencies
4+ FROM golang:1.13.4-alpine3.10
5+ ARG COMMIT
6+ ARG BRANCH
7+ ARG TIME
8+
9+ WORKDIR /go/src/app
10+ COPY . .
11+
12+ RUN GO111MODULE=on go build -mod vendor \
13+ --ldflags="-X main.jtimonVersion=${COMMIT}-${BRANCH} -X main.buildTime=${TIME}" \
14+ -o /usr/local/bin/jtimon
1415
1516VOLUME /u
1617WORKDIR /u
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ darwin: ## generate a osx version of the binary
2929 GOOS=darwin GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY} -darwin-${GOARCH} .
3030
3131docker : # # build a docker image that can be used to execute the binary
32- docker build -t jtimon .
32+ docker build --build-arg COMMIT= ${COMMIT} --build-arg BRANCH= ${BRANCH} --build-arg TIME= ${TIME} - t jtimon .
3333 ln -sf launch-docker-container.sh jtimon
3434 @echo " Usage: docker run -ti --rm jtimon --help"
3535 @echo " or simply call the shell script './jtimon --help"
You can’t perform that action at this time.
0 commit comments