adtoolsBuilder/Dockerfile

87 lines
2.5 KiB
Docker
Raw Permalink Normal View History

FROM alpine/git:2.40.1 AS git-clone
2022-02-01 19:47:39 +01:00
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
2022-02-01 19:47:39 +01:00
FROM ubuntu:latest AS builder
2022-02-01 19:47:39 +01:00
ENV AMIDEV_USER_ID=1000 \
AMIDEV_GROUP_ID=1000 \
PATH="/home/amidev/.local/bin:$PATH"
2022-02-01 19:47:39 +01:00
COPY --from=walkero/lha-on-docker /usr/bin/lha /usr/bin/lha
2022-02-01 19:47:39 +01:00
ENV PACKAGES="\
2022-02-01 19:47:39 +01:00
autoconf \
automake \
autopoint \
bison \
bzip2 \
ca-certificates \
curl \
2022-02-01 19:47:39 +01:00
dh-autoreconf \
flex \
g++-10 \
2022-02-01 19:47:39 +01:00
gettext \
git \
gperf \
gpg \
libfl2 \
2022-02-01 19:47:39 +01:00
libgmp-dev \
libmpc3 \
libmpc-dev \
libtool \
make \
mc \
nano \
patch \
python3 \
2022-02-01 19:47:39 +01:00
rsync \
texinfo \
wdiff \
2022-02-01 19:47:39 +01:00
wget \
xz-utils"
RUN apt-get update && \
apt-get -y --no-install-recommends install ${PACKAGES}; \
ln -s /usr/bin/g++-10 /usr/bin/g++; \
2022-02-01 19:47:39 +01:00
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;
2022-02-01 19:47:39 +01:00
# 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/
2022-02-01 19:47:39 +01:00
WORKDIR /opt/adtools
2022-02-01 19:47:39 +01:00
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;
2022-02-01 19:47:39 +01:00
# 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;
2022-02-01 19:47:39 +01:00
# USER root