Skip to content

Commit 6a7ebf7

Browse files
authored
Merge pull request #438 from concourse/wolfi-base
Switch to wolfi-base as the base image
2 parents 4a692c7 + a02e8e3 commit 6a7ebf7

File tree

3 files changed

+42
-175
lines changed

3 files changed

+42
-175
lines changed

Dockerfile

Lines changed: 38 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,55 @@
1-
ARG base_image
1+
ARG base_image=cgr.dev/chainguard/wolfi-base:latest
22

3-
FROM ${base_image} AS resource
4-
USER root
5-
6-
RUN apt update && apt upgrade -y -o Dpkg::Options::="--force-confdef"
7-
RUN apt install -y --no-install-recommends \
8-
curl \
3+
FROM ${base_image} AS proxytunnel
4+
RUN apk --no-cache add \
95
git \
10-
git-lfs \
11-
gnupg \
12-
gzip \
13-
jq \
14-
openssl \
15-
libssl-dev \
166
make \
17-
g++ \
18-
openssh-client \
19-
libstdc++6 \
20-
software-properties-common
7+
gcc \
8+
openssl-dev
219

2210
WORKDIR /root
2311
RUN git clone https://github.com/proxytunnel/proxytunnel.git && \
2412
cd proxytunnel && \
25-
make -j4 && \
26-
install -c proxytunnel /usr/bin/proxytunnel && \
27-
cd .. && \
28-
rm -rf proxytunnel
13+
make -j4
14+
15+
FROM ${base_image} AS resource
16+
COPY --from=proxytunnel /root/proxytunnel/proxytunnel /usr/bin/
17+
18+
# minimum dependencies we need for the resource
19+
RUN apk --no-cache add \
20+
bash \
21+
ca-certificates \
22+
coreutils \
23+
git \
24+
git-crypt \
25+
git-lfs \
26+
gnupg \
27+
gnupg-dirmngr \
28+
gpg \
29+
gpg-agent \
30+
jq \
31+
openssh
2932

3033
RUN git config --global user.email "git@localhost"
3134
RUN git config --global user.name "git"
3235
RUN git config --global pull.rebase "false"
3336
RUN git config --global protocol.file.allow "always"
3437

35-
ENV CXXFLAGS -DOPENSSL_API_COMPAT=0x30000000L
36-
ADD scripts/install_git_crypt.sh install_git_crypt.sh
37-
RUN ./install_git_crypt.sh && rm ./install_git_crypt.sh
38-
39-
WORKDIR /usr/libexec/git-core
40-
RUN rm -f \
41-
git-add \
42-
git-add--interactive \
43-
git-annotate \
44-
git-apply \
45-
git-archimport \
46-
git-archive \
47-
git-bisect--helper \
48-
git-blame \
49-
git-branch \
50-
git-bundle \
51-
git-credential-cache \
52-
git-credential-cache--daemon \
53-
git-credential-store \
54-
git-cat-file \
55-
git-check-attr \
56-
git-check-ignore \
57-
git-check-mailmap \
58-
git-check-ref-format \
59-
git-checkout \
60-
git-checkout-index \
61-
git-cherry \
62-
git-cherry-pick \
63-
git-clean \
64-
git-clone \
65-
git-column \
66-
git-commit \
67-
git-commit-tree \
68-
git-config \
69-
git-count-objects \
70-
git-credential \
71-
git-cvsexportcommit \
72-
git-cvsimport \
73-
git-cvsserver \
74-
git-describe \
75-
git-diff \
76-
git-diff-files \
77-
git-diff-index \
78-
git-diff-tree \
79-
git-difftool \
80-
git-fast-export \
81-
git-fast-import \
82-
git-fetch \
83-
git-fetch-pack \
84-
git-fmt-merge-msg \
85-
git-for-each-ref \
86-
git-format-patch \
87-
git-fsck \
88-
git-fsck-objects \
89-
git-gc \
90-
git-get-tar-commit-id \
91-
git-grep \
92-
git-hash-object \
93-
git-help \
94-
git-http-backend\
95-
git-imap-send \
96-
git-index-pack \
97-
git-init \
98-
git-init-db \
99-
git-lfs \
100-
git-log \
101-
git-ls-files \
102-
git-ls-remote \
103-
git-ls-tree \
104-
git-mailinfo \
105-
git-mailsplit \
106-
git-merge \
107-
git-mktag \
108-
git-mktree \
109-
git-mv \
110-
git-name-rev \
111-
git-notes \
112-
git-p4 \
113-
git-pack-objects \
114-
git-pack-redundant \
115-
git-pack-refs \
116-
git-patch-id \
117-
git-peek-remote \
118-
git-prune \
119-
git-prune-packed \
120-
git-push \
121-
git-read-tree \
122-
git-reflog \
123-
git-relink \
124-
git-remote \
125-
git-remote-ext \
126-
git-remote-fd \
127-
git-remote-testsvn \
128-
git-repack \
129-
git-replace \
130-
git-repo-config \
131-
git-rerere \
132-
git-reset \
133-
git-rev-list \
134-
git-rev-parse \
135-
git-revert \
136-
git-rm \
137-
git-send-email \
138-
git-send-pack \
139-
git-shortlog \
140-
git-show \
141-
git-show-branch \
142-
git-show-index \
143-
git-show-ref \
144-
git-stage \
145-
git-show-ref \
146-
git-stage \
147-
git-status \
148-
git-stripspace \
149-
git-svn \
150-
git-symbolic-ref \
151-
git-tag \
152-
git-tar-tree \
153-
git-unpack-file \
154-
git-unpack-objects \
155-
git-update-index \
156-
git-update-ref \
157-
git-update-server-info \
158-
git-upload-archive \
159-
git-var \
160-
git-verify-pack \
161-
git-verify-tag \
162-
git-whatchanged \
163-
git-write-tree
164-
165-
WORKDIR /usr/bin
166-
RUN rm -f \
167-
git-cvsserver \
168-
git-shell \
169-
git-receive-pack \
170-
git-upload-pack \
171-
git-upload-archive &&\
172-
ln -s git git-upload-archive &&\
173-
ln -s git git-merge &&\
174-
ln -s git git-crypt
38+
# Remove unrelated git binaries we don't need
39+
WORKDIR /usr/libexec/git-core
40+
RUN rm -f \
41+
git-archimport \
42+
git-cvsexportcommit \
43+
git-cvsimport \
44+
git-cvsserver \
45+
git-svn \
46+
git-web--browse
17547

176-
WORKDIR /usr/share
177-
RUN rm -rf \
178-
gitweb \
179-
locale \
180-
perl
48+
WORKDIR /usr/bin
49+
RUN rm -f git-cvsserver
18150

182-
WORKDIR /usr/lib
183-
RUN rm -rf \
184-
perl
51+
WORKDIR /usr/share
52+
RUN rm -rf locale
18553

18654
ADD assets/ /opt/resource/
18755
RUN chmod +x /opt/resource/*
@@ -191,7 +59,7 @@ ADD test/ /tests
19159
RUN /tests/all.sh
19260

19361
FROM resource AS integrationtests
194-
RUN apt update && apt install -y iproute2 squid
62+
RUN apk --no-cache add iproute2 squid
19563
ADD test/ /tests/test
19664
ADD integration-tests /tests/integration-tests
19765
RUN /tests/integration-tests/integration.sh

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ will stop the build.
399399
Run the tests with the following command:
400400

401401
```sh
402-
docker build -t git-resource --target tests --build-arg base_image=paketobuildpacks/run-noble-base:latest .
403-
402+
docker build -t git-resource --target tests .
404403
```
405404

406405
#### Note about the integration tests

test/get.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ it_does_not_enter_an_infinite_loop_if_the_ref_cannot_be_found_and_depth_is_set()
295295
echo $output $exit_code
296296
test "${exit_code}" = 128
297297
echo "${output}" | grep "Reached max depth of the origin repo while deepening the shallow clone, it's a deep clone now"
298-
echo "${output}" | grep "fatal: reference is not a tree: $ref2"
298+
echo "${output}" | grep "fatal: unable to read tree (${ref2})"
299299
}
300300

301301
it_can_use_submodules_with_names_that_arent_paths() {
@@ -448,7 +448,7 @@ it_fails_if_the_ref_cannot_be_found_while_deepening_a_submodule() {
448448
echo $output $exit_code
449449
test "${exit_code}" \!= 0
450450
echo "${output}" | grep "Reached max depth of the origin repo while deepening the shallow clone, it's a deep clone now"
451-
echo "${output}" | grep "fatal: reference is not a tree: $submodule_last_commit_id"
451+
echo "${output}" | grep "fatal: unable to read tree (${submodule_last_commit_id})"
452452
}
453453

454454
it_honors_the_parameter_flags_for_submodules() {
@@ -890,7 +890,7 @@ it_can_get_from_url_at_branch_with_search_remote_refs() {
890890

891891
echo $output $exit_code
892892
test "${exit_code}" = 128
893-
echo "$output" | grep "fatal: reference is not a tree: "
893+
echo "$output" | grep "fatal: unable to read tree ("
894894
test -e $dest/some-file
895895
test "$(git -C $dest rev-parse HEAD)" != $ref2
896896

0 commit comments

Comments
 (0)