Dockerfile
RUN apk --no-cache add openssh-client \
&& mkdir -p -m 0700 ~/.ssh \
&& git config --add --global url."ssh://git@github.com".insteadOf "https://github.com" \
&& ssh-keyscan github.com >> ~/.ssh/known_hosts
# e.g. RUN --mount=type=ssh go build
compose.yaml
services:
app:
build:
ssh:
- default