-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (61 loc) · 2.37 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
FROM outstand/fixuid as fixuid
FROM ruby:2.7.4-alpine3.13
LABEL maintainer="Ryan Schlesinger <[email protected]>"
RUN addgroup -S shipitron && \
adduser -S -G shipitron shipitron && \
addgroup -g 1101 docker && \
addgroup shipitron docker
RUN apk add --no-cache \
ca-certificates \
openssl-dev \
tini \
su-exec \
build-base \
git \
git-lfs \
openssh-client \
perl \
bash \
curl \
wget \
jq \
cmake
COPY --from=fixuid /usr/local/bin/fixuid /usr/local/bin/fixuid
RUN chmod 4755 /usr/local/bin/fixuid && \
USER=shipitron && \
GROUP=shipitron && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
ENV ECR_CREDENTIAL_HELPER_VERSION 0.6.0
RUN cd /usr/local/bin && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
chmod +x docker-credential-ecr-login
ENV BUILDKIT_VERSION v0.10.4
RUN cd /usr/local/bin && \
wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
chmod +x buildctl && \
rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
USER shipitron
ENV BUILDX_VERSION v0.9.1
RUN cd /home/shipitron && \
wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
mkdir -p ~/.docker/cli-plugins && \
mv buildx-${BUILDX_VERSION}.linux-amd64 ~/.docker/cli-plugins/docker-buildx && \
chmod a+x ~/.docker/cli-plugins/docker-buildx
USER root
ENV USE_BUNDLE_EXEC true
ENV BUNDLE_GEMFILE /shipitron/Gemfile
ENV BUNDLER_VERSION 2.3.22
RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force
WORKDIR /app
COPY Gemfile shipitron.gemspec /shipitron/
COPY lib/shipitron/version.rb /shipitron/lib/shipitron/
RUN git config --global push.default simple
COPY . /shipitron/
RUN mkdir -p /home/shipitron/.ssh && \
chown shipitron:shipitron /home/shipitron/.ssh && \
chmod 700 /home/shipitron/.ssh
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["help"]