mirror of https://github.com/docker/docs.git
Update build_enhancements.md
This commit is contained in:
parent
4e4398d158
commit
07855dc667
|
@ -173,19 +173,15 @@ Here is an example Dockerfile using SSH in the container:
|
||||||
|
|
||||||
```Dockerfile
|
```Dockerfile
|
||||||
# syntax=docker/dockerfile:experimental
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
# Install ssh client and git
|
# Install ssh client and git
|
||||||
|
|
||||||
RUN apk add --no-cache openssh-client git
|
RUN apk add --no-cache openssh-client git
|
||||||
|
|
||||||
# Download public key for github.com
|
# Download public key for github.com
|
||||||
|
|
||||||
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
|
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
# Clone private repository
|
# Clone private repository
|
||||||
|
|
||||||
RUN --mount=type=ssh git clone git@github.com:myorg/myproject.git myproject
|
RUN --mount=type=ssh git clone git@github.com:myorg/myproject.git myproject
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue