-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargparser.dockerfile
More file actions
58 lines (49 loc) · 1.58 KB
/
Copy pathargparser.dockerfile
File metadata and controls
58 lines (49 loc) · 1.58 KB
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
# Author: Simon Brandt
# E-Mail: simon.brandt@uni-greifswald.de
# Last Modification: 2025-08-20
# License: Public Domain
FROM ubuntu:24.04
# Install the dependencies.
SHELL [ "/bin/bash", "-c" ]
RUN apt-get update \
&& apt-get install --yes \
autoconf \
gcc \
git \
locales \
make \
&& rm --force --recursive /var/lib/apt/lists/*
# Set the Bash version, which can be overridden by the "--build-arg"
# option to "docker build".
ARG VERSION=5.3
ARG GIT_SHA1="b8c60bc"
# Download and install Bash in the given version and Git commit hash.
# Remove the unneeded .git directory to keep the layer slim.
WORKDIR /opt
RUN git clone --branch=bash-${VERSION} git://git.git.savannah.gnu.org/bash.git \
&& cd /opt/bash \
&& git reset --hard ${GIT_SHA1} \
&& ./configure \
&& make \
&& make tests \
&& make install \
&& rm --force --recursive -- .git
# Copy the Argparser, all test scripts, and their dependencies (the
# resources) into the image.
WORKDIR /opt/argparser
COPY --from=parent argparser .
COPY --from=parent tests tests/
COPY --from=parent resources resources/
# Set the PATH and locale.
ENV PATH="/opt/bash:/opt/argparser:${PATH}"
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# Add a non-root user.
RUN useradd --create-home --user-group --uid=1001 user
USER user
# Set the test suite to run under Bash in the given version. For manual
# introspection, use a customized prompt stating Bash's version.
WORKDIR /opt/argparser/tests
RUN echo "PS1='bash-\V:\w\$ '" >> "${HOME}/.bashrc"
ENTRYPOINT [ "bash" ]