-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (66 loc) · 2.31 KB
/
Dockerfile
File metadata and controls
78 lines (66 loc) · 2.31 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM debian:12.7
SHELL ["bash", "-euxo", "pipefail", "-c"]
RUN set -euxo pipefail >/dev/null \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -qq --yes \
&& apt-get install -qq --no-install-recommends --yes \
bash \
ca-certificates \
curl \
git \
make \
sudo \
tar \
xz-utils \
>/dev/null \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean autoclean >/dev/null \
&& apt-get autoremove --yes >/dev/null
ENV TRIPLET="x86_64-w64-mingw32"
ENV GCC_DIR="/opt/gcc"
RUN set -euxo pipefail >/dev/null \
&& mkdir -p "${GCC_DIR}" \
&& curl -fsSL "https://github.com/binarylandia/build_crosstool-ng/releases/download/2024-11-02_10-18-46/gcc-14.2.0-${TRIPLET}-2024-11-02_10-18-46.tar.xz" | tar -C "${GCC_DIR}" -xJ \
&& ls ${GCC_DIR}/bin/${TRIPLET}-gcc \
&& ${GCC_DIR}/bin/${TRIPLET}-gcc -v \
&& ls ${GCC_DIR}/bin/${TRIPLET}-gcc-ar \
&& ${GCC_DIR}/bin/${TRIPLET}-gcc-ar --version
ENV CC="${GCC_DIR}/bin/${TRIPLET}-cc"
ENV CXX="${GCC_DIR}/bin/${TRIPLET}-g++"
ENV FC="${GCC_DIR}/bin/${TRIPLET}-gfortran"
ENV ADDR2LINE="${GCC_DIR}/bin/${TRIPLET}-addr2line"
ENV AR="${GCC_DIR}/bin/${TRIPLET}-gcc-ar"
ENV AS="${GCC_DIR}/bin/${TRIPLET}-as"
ENV CPP="${GCC_DIR}/bin/${TRIPLET}-cpp"
ENV ELFEDIT="${GCC_DIR}/bin/${TRIPLET}-elfedit"
ENV LD="${GCC_DIR}/bin/${TRIPLET}-ld"
ENV LDD="${GCC_DIR}/bin/${TRIPLET}-ldd"
ENV NM="${GCC_DIR}/bin/${TRIPLET}-gcc-nm"
ENV OBJCOPY="${GCC_DIR}/bin/${TRIPLET}-objcopy"
ENV OBJDUMP="${GCC_DIR}/bin/${TRIPLET}-objdump"
ENV RANLIB="${GCC_DIR}/bin/${TRIPLET}-gcc-ranlib"
ENV READELF="${GCC_DIR}/bin/${TRIPLET}-readelf"
ENV SIZE="${GCC_DIR}/bin/${TRIPLET}-size"
ENV STRINGS="${GCC_DIR}/bin/${TRIPLET}-strings"
ENV STRIP="${GCC_DIR}/bin/${TRIPLET}-strip"
ARG USER=user
ARG GROUP=user
ARG UID
ARG GID
ENV USER=$USER
ENV GROUP=$GROUP
ENV UID=$UID
ENV GID=$GID
ENV TERM="xterm-256color"
ENV HOME="/home/${USER}"
COPY docker/files /
RUN set -euxo pipefail >/dev/null \
&& /create-user \
&& sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^#includedir.*/## **Removed the include directive** ##"/g' \
&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& touch ${HOME}/.hushlogin \
&& chown -R ${UID}:${GID} "${HOME}"
USER ${USER}