Skip to content

Commit 0b0e871

Browse files
author
Paul Belt
committed
doc: update docker docs assuming blank slate
1 parent 05101e5 commit 0b0e871

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,37 @@ Follow linked crate name for detailed status. Please note that all crates follow
6464

6565
### Pipeline Integration
6666

67-
Some CI/CD pipelines leverage repository cloning. Below is a copy-paste-able example to build docker images for such workflows.
67+
Some CI/CD pipelines leverage repository cloning. Below is a copy-paste-able example to build docker images for such workflows. As no official image exists (at this time), one must first be built.
6868

69-
#### Pipeline Integration (recommended)
69+
#### Pipeline Integration - building the base image (when speed matters)
7070

71-
Build an image without a target and then copy the binaries into your local image
72-
73-
```dockerfile
74-
COPY --from gitoxide:latest /bin/gix /usr/local/bin/
75-
COPY --from gitoxide:latest /bin/ein /usr/local/bin/
71+
```sh
72+
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress . --target=pipeline
7673
```
7774

78-
#### Pipeline Integration (base image)
75+
#### Pipeline Integration - building a smaller base image (when bits on the wire matter)
7976

8077
```sh
81-
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress . --target=pipeline
78+
docker build -f etc/docker/Dockerfile.bookworm -t gitoxide:latest --compress . --target=pipeline
8279
```
8380

84-
Debian distributions can use:
81+
Once a docker image is built there are 2 options. One can replace `FROM alpine:latest` (or `FROM debian:bookworm-slim`) with `FROM gitoxide:latest`, or the resulting binaries can be copied into an existing `Dockerfile` and leveraged as a drop-in replacement for `git clone` directives.
82+
83+
#### Pipeline Integration - minimal
84+
85+
For example, if a `Dockerfile` currently uses something like `RUN git clone https://github.com/Byron/gitoxide`, first build the minimal image:
8586

8687
```sh
87-
docker build -f etc/docker/Dockerfile.bookworm -t gitoxide:latest --compress . --target=pipeline
88+
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress .
89+
```
90+
91+
Then copy the binaries into your image and replace the `git` directive with a `gix` equivalent.
92+
93+
```dockerfile
94+
COPY --from gitoxide:latest /bin/gix /usr/local/bin/
95+
COPY --from gitoxide:latest /bin/ein /usr/local/bin/
96+
97+
RUN /usr/local/bin/gix clone --depth 1 https://github.com/Byron/gitoxide gitoxide
8898
```
8999

90100
### Production Grade

0 commit comments

Comments
 (0)