Skip to content

Commit 177bb2a

Browse files
committed
Remove SSH access from Dockerfile
1 parent f608b8b commit 177bb2a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ FROM golang:1.16 AS build-app
55

66
ARG VERSION
77

8-
# add the pubkey of github.com to knownhosts, so ssh-agent doesn't bark
9-
RUN mkdir -p /root/.ssh && ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
10-
RUN git config --global 'url.ssh://git@github.com/.insteadof' https://github.com/
11-
128
# Build the app binary in /app
139
RUN mkdir /app
1410
WORKDIR /app
@@ -17,9 +13,7 @@ COPY . .
1713

1814
# Keep Go's build cache between builds.
1915
# https://github.com/golang/go/issues/27719#issuecomment-514747274
20-
# Also, allow ssh access
21-
RUN --mount=type=ssh \
22-
--mount=type=cache,target=/go/pkg/mod \
16+
RUN --mount=type=cache,target=/go/pkg/mod \
2317
--mount=type=cache,target=/root/.cache/go-build \
2418
GO111MODULE=on GOOS=linux GOARCH=amd64 \
2519
go build \

0 commit comments

Comments
 (0)