Commit 0611ea12 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

alpine: Don't run as root

parent e09d9ede
......@@ -20,12 +20,19 @@ RUN echo "Installing GHC build dependencies..." && \
bash=~4.4 \
git=~2.20 \
wget=~1.20 \
sudo \
cabal=~2.2
RUN cabal update
RUN cabal install alex happy
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
WORKDIR /home/ghc/
ENV ALEX=/root/.cabal/bin/alex \
HAPPY=/root/.cabal/bin/happy \
SPHINXBUILD=/usr/bin/sphinx-build-3
# Build Haskell tools
RUN cabal update && \
cabal install hscolour happy alex --constraint 'happy ^>= 1.19.10'
ENV PATH /home/ghc/.cabal/bin:$PATH
ENV SPHINXBUILD /usr/bin/sphinx-build-3
CMD ["bash"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment