forked from concourse/git-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
225 lines (206 loc) · 6.91 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
FROM alpine:edge AS tunnelbuilder
RUN apk --no-cache add git make gcc g++ openssl-dev
WORKDIR /root
RUN git clone https://github.com/proxytunnel/proxytunnel.git
WORKDIR /root/proxytunnel
RUN git checkout 1cb544cdd5096445636a82bec45d555d51252b9d && make -j2
FROM alpine:edge AS resource
RUN apk --no-cache add \
bash \
curl \
git \
git-daemon \
gnupg \
gzip \
jq \
openssh \
perl \
tar \
openssl \
libstdc++ \
dumb-init
COPY --from=tunnelbuilder /root/proxytunnel/proxytunnel proxytunnel
RUN /usr/bin/install -c proxytunnel /usr/bin/proxytunnel
RUN git config --global user.email "git@localhost"
RUN git config --global user.name "git"
ADD assets/ /opt/resource/
RUN chmod +x /opt/resource/*
ADD scripts/install_git_lfs.sh install_git_lfs.sh
RUN ./install_git_lfs.sh && rm ./install_git_lfs.sh
ADD scripts/install_git_crypt.sh install_git_crypt.sh
RUN ./install_git_crypt.sh && rm ./install_git_crypt.sh
WORKDIR /usr/libexec/git-core
RUN rm -f \
git-add \
git-add--interactive \
git-annotate \
git-apply \
git-archimport \
git-archive \
git-bisect--helper \
git-blame \
git-branch \
git-bundle \
git-credential-cache \
git-credential-cache--daemon \
git-credential-store \
git-cat-file \
git-check-attr \
git-check-ignore \
git-check-mailmap \
git-check-ref-format \
git-checkout \
git-checkout-index \
git-cherry \
git-cherry-pick \
git-clean \
git-clone \
git-column \
git-commit \
git-commit-tree \
git-config \
git-count-objects \
git-credential \
git-cvsexportcommit \
git-cvsimport \
git-cvsserver \
git-describe \
git-diff \
git-diff-files \
git-diff-index \
git-diff-tree \
git-difftool \
git-fast-export \
git-fast-import \
git-fetch \
git-fetch-pack \
git-fmt-merge-msg \
git-for-each-ref \
git-format-patch \
git-fsck \
git-fsck-objects \
git-gc \
git-get-tar-commit-id \
git-grep \
git-hash-object \
git-help \
git-http-backend\
git-imap-send \
git-index-pack \
git-init \
git-init-db \
git-log \
git-ls-files \
git-ls-remote \
git-ls-tree \
git-mailinfo \
git-mailsplit \
git-merge \
git-mktag \
git-mktree \
git-mv \
git-name-rev \
git-notes \
git-p4 \
git-pack-objects \
git-pack-redundant \
git-pack-refs \
git-patch-id \
git-peek-remote \
git-prune \
git-prune-packed \
git-push \
git-read-tree \
git-reflog \
git-relink \
git-remote \
git-remote-ext \
git-remote-fd \
git-remote-testsvn \
git-repack \
git-replace \
git-repo-config \
git-rerere \
git-reset \
git-rev-list \
git-rev-parse \
git-revert \
git-rm \
git-send-email \
git-send-pack \
git-shell \
git-shortlog \
git-show \
git-show-branch \
git-show-index \
git-show-ref \
git-stage \
git-show-ref \
git-stage \
git-status \
git-stripspace \
git-svn \
git-symbolic-ref \
git-tag \
git-tar-tree \
git-unpack-file \
git-unpack-objects \
git-update-index \
git-update-ref \
git-update-server-info \
git-upload-archive \
git-var \
git-verify-pack \
git-verify-tag \
git-whatchanged \
git-write-tree
WORKDIR /usr/bin
RUN rm -f \
git \
git-cvsserver \
git-shell \
git-receive-pack \
git-upload-pack \
git-upload-archive &&\
ln -s ../libexec/git-core/git git &&\
ln -s ../libexec/git-core/git-shell git-shell &&\
ln -s ../libexec/git-core/git git-upload-archive &&\
ln -s ../libexec/git-core/git-upload-pack git-upload-pack
WORKDIR /usr/libexec/git-core
RUN ln -s git git-merge
WORKDIR /usr/share
RUN rm -rf \
gitweb \
locale \
perl \
perl5
# Clean up Perl but keep the CORE folder.
WORKDIR /usr/lib
RUN for i in /usr/lib/perl*; do \
cd $i/*/; \
find \
-maxdepth 1 -mindepth 1 \
-not -name CORE \
-exec rm -rf {} \;; \
cd -; \
done
ENTRYPOINT ["/usr/bin/dumb-init"]
FROM resource AS tests
ARG SKIP_TESTS=false
ADD test/ /tests
RUN if [ "${SKIP_TESTS}" == 'false' ]; then \
/tests/all.sh; \
else \
echo "Skip arg specified, skipping tests."; \
fi
FROM resource AS integrationtests
ARG SKIP_TESTS=false
RUN apk --no-cache add squid
ADD test/ /tests/test
ADD integration-tests /tests/integration-tests
RUN if [ "${SKIP_TESTS}" == 'false' ]; then \
/tests/integration-tests/integration.sh; \
else \
echo "Skip arg specified, skipping integration tests."; \
fi
FROM resource