Skip to content

Commit 4ca7f6c

Browse files
committed
refactor
- remove ci/docker step as it takes too long at 61 minutes - remove `docker.alpine` - add note that it might degrade
1 parent dc0ec2b commit 4ca7f6c

File tree

4 files changed

+30
-132
lines changed

4 files changed

+30
-132
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,6 @@ jobs:
150150
run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --no-default-features --features max-pure --target-dir install-artifacts --debug --force gitoxide
151151
shell: msys2 {0}
152152

153-
docker:
154-
runs-on: ubuntu-latest
155-
steps:
156-
- uses: actions/checkout@v4
157-
- name: Set up Docker Buildx
158-
uses: docker/setup-buildx-action@v3
159-
- name: Build Docker image
160-
uses: docker/build-push-action@v5
161-
with:
162-
context: .
163-
file: ./etc/docker/Dockerfile.alpine
164-
platforms: linux/amd64,linux/arm64
165-
push: false
166-
tags: paulbelt/gitoxide:latest
167-
168153
lint:
169154
runs-on: ubuntu-latest
170155
steps:

README.md

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -62,41 +62,6 @@ Follow linked crate name for detailed status. Please note that all crates follow
6262

6363
[semver]: https://semver.org
6464

65-
### Pipeline Integration
66-
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.
68-
69-
#### Pipeline Integration - building the base image (when speed matters)
70-
71-
```sh
72-
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress . --target=pipeline
73-
```
74-
75-
#### Pipeline Integration - building a smaller base image (when bits on the wire matter)
76-
77-
```sh
78-
docker build -f etc/docker/Dockerfile.bookworm -t gitoxide:latest --compress . --target=pipeline
79-
```
80-
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:
86-
87-
```sh
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
98-
```
99-
10065
### Production Grade
10166

10267
* **Stability Tier 1**
@@ -261,6 +226,35 @@ What follows is a list of known failures.
261226

262227
- On Fedora, `perl` needs to be installed for `OpenSSL` to build properly. This can be done with the following command:
263228
`dnf install perl` (see [this issue](https://github.com/Byron/gitoxide/issues/592)).
229+
-
230+
### Using Docker
231+
232+
Some CI/CD pipelines leverage repository cloning. Below is a copy-paste-able example to build docker images for such workflows.
233+
As no official image exists (at this time), an image must first be built.
234+
235+
#### Building the most compatible base image
236+
237+
```sh
238+
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress . --target=pipeline
239+
```
240+
241+
#### Basic usage in a Pipeline
242+
243+
For example, if a `Dockerfile` currently uses something like `RUN git clone https://github.com/Byron/gitoxide`, first build the image:
244+
245+
```sh
246+
docker build -f etc/docker/Dockerfile.alpine -t gitoxide:latest --compress .
247+
```
248+
249+
Then copy the binaries into your image and replace the `git` directive with a `gix` equivalent.
250+
251+
```dockerfile
252+
COPY --from gitoxide:latest /bin/gix /usr/local/bin/
253+
COPY --from gitoxide:latest /bin/ein /usr/local/bin/
254+
255+
RUN /usr/local/bin/gix clone --depth 1 https://github.com/Byron/gitoxide gitoxide
256+
```
257+
264258

265259
[releases]: https://github.com/Byron/gitoxide/releases
266260
[rustup]: https://rustup.rs

etc/docker/Dockerfile.alpine

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Please note that this file is not regularly tested, and you are welcome to create PRs with fixes as needed.
12
ARG GITOXIDE_VERSION=0.36.0
23

34
FROM rust:alpine AS bootstrap_os

etc/docker/Dockerfile.bookworm

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)