-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.staging
70 lines (57 loc) · 2.16 KB
/
Dockerfile.staging
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
FROM ruby:2.7.4-alpine3.13
LABEL maintainer="Ryan Schlesinger <[email protected]>"
RUN addgroup -S -g 1000 shipitron && \
adduser -S -u 1000 -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
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 /shipitron
COPY Gemfile shipitron.gemspec /shipitron/
COPY lib/shipitron/version.rb /shipitron/lib/shipitron/
COPY exe/shipitron /shipitron/exe/shipitron
COPY .git/ /shipitron/
RUN bundle install
COPY . /shipitron/
RUN mkdir -p /home/shipitron/.ssh && \
chown shipitron:shipitron /home/shipitron/.ssh && \
chmod 700 /home/shipitron/.ssh
WORKDIR /app
COPY scripts/release-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["help"]