golang[75]-docker中编译go mod
在docker中编译 Go mod程序。
并且可以用到gitlab的私有仓库:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| FROM golang:alpine
RUN apk update RUN apk add --no-cache git RUN apk add openssh ADD id_ed25519 /root/.ssh/id_ed25519 RUN chmod 600 /root/.ssh/id_ed25519
RUN echo -e "[url \"git@gitlab.followme.com:\"]\n\tinsteadOf = https://gitlab.followme.com/" >> /root/.gitconfig # Skip Host verification for git RUN echo "StrictHostKeyChecking no " > /root/.ssh/config WORKDIR /contour COPY . . RUN go build -o remote -v viperRemote/viperRemote.go ENTRYPOINT ["./remote"]
|
https://medium.com/paperchain/fetching-private-github-repos-from-a-docker-container-273f25ec5a74
灾难总是接踵而至,这正是世间的常理。你以为只要哭诉一下,就会有谁来救你?如果失败了,就只能说明我不过是如此程度的男人