docker-cross-compiler/Dockerfile

83 lines
2.3 KiB
Docker
Raw Normal View History

2024-03-19 16:01:11 +01:00
# This is going to create an environment for you to cross compile all the
# packages needed to build this project.
#
# As always, debian > ubuntu <3
FROM debian:stable-slim
WORKDIR /root
# Set host name.
RUN echo docker_cross_compiler > /etc/hostname
# Download and Install dependencies.
# Install WGET
RUN apt-get update
RUN apt-get install -y sudo wget
# Add the .NET package repository to the repository listing.
RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
# APT dependencies.
RUN apt-get update
RUN apt-get install -y \
build-essential \
bzip2 \
cmake \
clang \
cpio \
2024-03-30 12:13:32 +01:00
curl \
2024-03-19 16:01:11 +01:00
dotnet-sdk-6.0 \
dotnet-sdk-8.0 \
2024-03-19 16:01:11 +01:00
gcc-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
gcc-i686-linux-gnu \
git \
2024-03-30 12:13:32 +01:00
libbz2-dev \
2024-03-19 16:01:11 +01:00
libharfbuzz-dev \
libpng-dev \
libssl-dev \
libxml2-dev \
2024-03-30 12:13:32 +01:00
llvm \
2024-03-19 16:01:11 +01:00
lzma-dev \
mingw-w64 \
meson \
2024-03-19 16:01:11 +01:00
nuget \
ninja-build \
2024-03-23 09:11:32 +01:00
nodejs \
2024-03-19 16:01:11 +01:00
patch \
python3 \
2024-03-30 12:13:32 +01:00
uuid \
2024-03-19 16:01:11 +01:00
xz-utils \
zlib1g-dev
# Clone osxcross
# Let's do this later.
2024-03-30 12:13:32 +01:00
RUN git clone --recurse-submodules "https://github.com/tpoechtrager/osxcross.git" osxcross
# Download packaged SDK from this random github (very safe i know)
WORKDIR /root/osxcross/tarballs
RUN wget "https://github.com/joseluisq/macosx-sdks/releases/download/14.0/MacOSX14.0.sdk.tar.xz" -O "MacOSX14.0.sdk.tar.xz"
WORKDIR /root/osxcross
ENV UNATTENDED=1 TARGET_DIR=/usr/local SDK_DIR=/usr/local/osxcross-sdk
RUN bash -c "./build.sh"
2024-03-19 16:01:11 +01:00
# Setup interactive shell.
# Setup sudo. Remove password prompt for group "wheel".
2024-06-13 19:57:08 +02:00
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/refuel_sudo_conf
2024-03-19 16:01:11 +01:00
# Create a default user and switch.
2024-06-13 19:57:08 +02:00
RUN adduser --comment "" --disabled-password refuel
2024-03-30 12:13:32 +01:00
RUN addgroup wheel
2024-06-13 19:57:08 +02:00
RUN usermod -aG wheel refuel
USER refuel
WORKDIR /home/refuel
2024-03-19 16:01:11 +01:00
# Copy bashrc
RUN cp /etc/bash.bashrc ~/.bashrc
2024-06-13 19:57:08 +02:00
COPY sh/bashrc.sh /home/refuel/.bashrc
2024-03-19 16:01:11 +01:00
# Execute an interactive shell.
CMD bash