-
Notifications
You must be signed in to change notification settings - Fork 1
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
Alpine Linux images #10
Labels
Comments
Note: For amd64/aarch64, when try build alpine-ldc2 sampleARG IMAGE=alpine
ARG BASE_VERSION=latest
FROM ${IMAGE}:${BASE_VERSION}
RUN apk update && apk add --no-cache \
sudo \
dmd \
clang \
cmake \
ninja \
llvm-dev \
llvm-libunwind-static \
llvm-static
RUN cd /root
RUN wget -q -c https://github.com/ldc-developers/ldc/releases/download/v1.37.0/ldc-1.37.0-src.tar.gz && tar xf ldc-1.37.0-src.tar.gz
RUN cd ldc-1.37.0-src \
&& cmake -B build \
-DCMAKE_INSTALL_PREFIX="/usr" \
-GNinja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ \
-DLLVM_IS_SHARED=OFF \
&& cmake --build build --parallel \
&& ninja -C build install \
&& cd ..
RUN wget -q -c https://github.com/dlang/dub/archive/refs/tags/v1.37.0.tar.gz \
&& tar xf v1.37.0.tar.gz \
&& cd dub-1.37.0 \
&& dmd -O build.d && $PWD/build \
&& chmod +x $PWD/bin/dub \
&& mv $PWD/bin/dub /usr/bin/dub \
&& cd ..
RUN apk del dmd cmake ninja \
&& rm -fr ldc-1.37.0-src* dub-1.37.0 v1.37.0.tar.gz
WORKDIR /app
ARG UNAME=dman
ARG UID=1000
ARG GID=1000
RUN addgroup -S $UNAME
RUN adduser \
--disabled-password \
--gecos "" \
--home "$(pwd)" \
--ingroup "$UNAME" \
--no-create-home \
--uid "$UID" \
"$UNAME"
RUN echo "$UNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$UNAME \
&& chmod 0440 /etc/sudoers.d/$UNAME
RUN chown -R $UNAME:$UNAME /app
USER $UNAME cc: @0xEAB |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should also provide images based on Alpine Linux.
People like to use Alpine Linux as their base image because it’s lightweight.
Ref: https://hub.docker.com/_/alpine
The text was updated successfully, but these errors were encountered: