Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Build with Alpine Linux #58

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
FROM debian:trixie-slim
FROM alpine
RUN \
apk update && apk upgrade && \
apk add --no-cache curl

ARG DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=$DEBIAN_FRONTEND
# [SR-4632] Swift on Alpine Linux (support musl libc)
# https://github.com/swiftlang/swift/issues/47209
# Swift on Alpine not yet supported
#
# RUN curl -s https://archive.swiftlang.xyz/install.sh | bash && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this ran, I got the error that the operating system was unsupported.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

musl support is an open issue under certain conditions, but that looks like more of an arbitrary restriction of the installer script. I need to test it in a real env.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it. Swift can crosscompile to support musl and so alpine as target. It cannot run on it yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. For reference: Building from source or the options above it. That could be done in the Dockerfile.


RUN \
apt update && apt upgrade -y && \
apt install -y curl && \
curl -s https://archive.swiftlang.xyz/install.sh | bash && \
apt install -y \
build-essential \
apk add --no-cache \
bash \
ca-certificates \
clang-19 \
clang \
cmake \
freeglut3-dev \
curl-dev \
freeglut-dev \
git \
libcurl4-openssl-dev \
libpango1.0-dev \
libpng-dev \
libsqlite3-0 \
libsqlitecpp-dev \
libtcc-dev \
lsb-release \
meson \
pkg-config \
pango-dev \
pkgconf \
shadow # For useradd \
sudo \
swiftlang \
unzip \
wget

RUN useradd -m builder -s /bin/bash && passwd -d builder
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
RUN echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
WORKDIR /home/builder
USER builder

Expand Down