adtoolsBuilder/Dockerfile

87 lines
2.5 KiB
Docker

FROM alpine/git:2.40.1 AS git-clone
RUN mkdir /repos; \
# git clone https://github.com/sba1/adtools /repos/adtools --depth 1; \
git clone https://github.com/AmigaLabs/adtools.git /repos/adtools --depth 1; \
git clone https://github.com/bminor/binutils-gdb /repos/binutils-gdb; \
git clone https://github.com/coreutils/coreutils /repos/coreutils; \
git clone https://github.com/coreutils/gnulib /repos/gnulib
FROM ubuntu:latest AS builder
ENV AMIDEV_USER_ID=1000 \
AMIDEV_GROUP_ID=1000 \
PATH="/home/amidev/.local/bin:$PATH"
COPY --from=walkero/lha-on-docker /usr/bin/lha /usr/bin/lha
ENV PACKAGES="\
autoconf \
automake \
autopoint \
bison \
bzip2 \
ca-certificates \
curl \
dh-autoreconf \
flex \
g++-10 \
gettext \
git \
gperf \
gpg \
libfl2 \
libgmp-dev \
libmpc3 \
libmpc-dev \
libtool \
make \
mc \
nano \
patch \
python3 \
rsync \
texinfo \
wdiff \
wget \
xz-utils"
RUN apt-get update && \
apt-get -y --no-install-recommends install ${PACKAGES}; \
ln -s /usr/bin/g++-10 /usr/bin/g++; \
rm /usr/bin/gcc; \
ln -s /usr/bin/gcc-10 /usr/bin/gcc; \
\
ln -s /usr/bin/python3 /usr/bin/python; \
curl -fsSL https://bootstrap.pypa.io/pip/get-pip.py -o /tmp/get-pip.py && \
python /tmp/get-pip.py && \
pip3 install --no-cache-dir mako;
# Copy necessary repos from git-clone
COPY --from=git-clone /repos/adtools /opt/adtools
COPY --from=git-clone /repos/binutils-gdb /opt/adtools/binutils/repo
COPY --from=git-clone /repos/coreutils /opt/adtools/coreutils/repo
COPY --from=git-clone /repos/gnulib /opt/adtools/gnulib/repo
COPY ./scripts/build-gcc.sh /opt/adtools
COPY ./scripts/setup-user.sh /setup-user.sh
COPY ./files/gcc-build/Makefile /opt/adtools/gcc-build/
WORKDIR /opt/adtools
RUN chmod +x /setup-user.sh ./build-gcc.sh; \
bash /setup-user.sh && rm /setup-user.sh; \
chown ${AMIDEV_USER_ID}:${AMIDEV_GROUP_ID} /opt -R;
# USER amidev
RUN git config --global --add safe.directory /opt/adtools; \
git config --global --add safe.directory /opt/adtools/binutils/repo; \
git config --global --add safe.directory /opt/adtools/coreutils/repo; \
git config --global --add safe.directory /opt/adtools/gnulib/repo; \
git config --global user.email "walkero@gmail.com"; \
git config --global user.name "Georgios Sokianos"; \
git submodule init && \
git submodule update;
# USER root