-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
69 lines (52 loc) · 1.9 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
FROM ubuntu:22.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
gcc \
make \
git \
curl \
openssh-client \
ca-certificates \
tar \
gzip \
ruby-dev \
python3-setuptools \
python3-pip \
python3-dev && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
ARG HADOLINT_VERSION="2.12.0"
RUN curl -OLs https://github.com/hadolint/hadolint/releases/download/v"${HADOLINT_VERSION}"/hadolint-Linux-x86_64 && \
mv hadolint-Linux-x86_64 /usr/local/bin/hadolint && \
chmod a+x /usr/local/bin/hadolint
ARG VAGRANT_VERSION="2.4.0"
RUN if dpkg --compare-versions "${VAGRANT_VERSION}" ge 2.3.0; then \
VERSION="${VAGRANT_VERSION}-1"; \
ARCH=amd64; \
else \
VERSION="${VAGRANT_VERSION}"; \
ARCH=x86_64; \
fi && \
curl -OLs https://releases.hashicorp.com/vagrant/"${VAGRANT_VERSION}"/vagrant_"${VERSION}"_"${ARCH}".deb && \
dpkg -i vagrant_"${VERSION}"_"${ARCH}".deb && \
rm vagrant_"${VERSION}"_"${ARCH}".deb
ARG BUNDLER_VERSION="2.4.18"
RUN gem install bundler --version "${BUNDLER_VERSION}"
ARG USERNAME="ci" \
USERGROUP="ci"
WORKDIR /home/"${USERNAME}"
RUN groupadd -r "${USERGROUP}" && \
useradd -r -g "${USERGROUP}" -d /home/"${USERNAME}" -c "Docker image user" "${USERNAME}" && \
chown -R "${USERNAME}":"${USERGROUP}" /home/"${USERNAME}"
USER "${USERNAME}"
# See: https://github.com/pypa/pip/issues/10219
ENV LANG="C.UTF-8" \
PATH="/home/${USERNAME}/.local/bin:${PATH}"
ARG PIP_VERSION="23.2.1" \
TOX_VERSION="4.6.4"
RUN python3 -m pip install --user --no-compile --no-cache-dir --upgrade pip=="${PIP_VERSION}" && \
python3 -m pip install --user --no-compile --no-cache-dir tox=="${TOX_VERSION}"
ENV BUNDLE_PATH="/home/${USERNAME}"
ENV BUNDLE_BIN="${BUNDLE_PATH}/bin"
ENV PATH="${BUNDLE_BIN}:${PATH}"
RUN bundle config set without "development test"
CMD ["bash"]