aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/Dockerfile.base
blob: a2e8ae45b8c660af4751ec060f2790d9db2ad27d (plain) (tree)
1
2
3
4
5
6
7
8
9
                         


                         
                       
                                                                            
                         

                              
                
 

                              

















                                                                     

                                                                                       


                                             
 
                                        
 






                                            
 

                                    
FROM debian:bullseye-slim

SHELL ["/bin/bash", "-c"]

RUN apt update -yq && \
    DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends \
        build-essential \
        ca-certificates wget \
        gosu sudo \
        nano vim

ARG DEFAULT_UID=999
ARG DEFAULT_GID="$DEFAULT_UID"

ARG JEKYLL_UID
ARG JEKYLL_GID
RUN test -n "$JEKYLL_UID" && test -n "$JEKYLL_GID"
ENV JEKYLL_UID="$JEKYLL_UID"
ENV JEKYLL_GID="$JEKYLL_GID"

RUN if [ "$JEKYLL_UID" = 0 ]; then JEKYLL_UID="$DEFAULT_UID"; fi && \
    if [ "$JEKYLL_GID" = 0 ]; then JEKYLL_GID="$DEFAULT_GID"; fi && \
    addgroup --gid "${JEKYLL_GID:-$DEFAULT_GID}" jekyll && \
    adduser \
        --disabled-password \
        --gecos '' \
        --home /home/jekyll \
        --ingroup jekyll \
        --uid "${JEKYLL_UID:-$DEFAULT_UID}" \
        jekyll && \
    addgroup jekyll sudo && \
    echo -e '%sudo ALL=(ALL) NOPASSWD:ALL\nDefaults env_keep += "HOME"' >> /etc/sudoers

RUN mkdir /utils && chown jekyll /utils
WORKDIR /utils
COPY --chown=jekyll:jekyll ["Makefile", "./"]

ENV PATH="/home/jekyll/.local/bin:$PATH"

RUN gosu jekyll make ruby-install && \
    gosu jekyll make ruby-install/clean && \
    gosu jekyll make ruby && \
    gosu jekyll make chruby && \
    gosu jekyll make chruby/.bashrc && \
    gosu jekyll make chruby/clean && \
    gosu jekyll make bundler

COPY ["docker-entrypoint.sh", "/"]
ENTRYPOINT ["/docker-entrypoint.sh"]