aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Dockerfile.base
blob: 29572892b9dcacda54f1b071bd983b6e2b86d30b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM debian:buster-slim

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

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update -yq && \
    apt install -yq --no-install-recommends \
        build-essential \
        ca-certificates wget \
        sudo

# Creating regular user 'developer':
ARG JEKYLL_USER=developer
ENV JEKYLL_USER="$JEKYLL_USER"
RUN addgroup "$JEKYLL_USER" && \
    adduser --disabled-password --gecos "" --ingroup "$JEKYLL_USER" --home "/home/$JEKYLL_USER" "$JEKYLL_USER" && \
    addgroup "$JEKYLL_USER" sudo && \
    echo -e '%sudo ALL=(ALL) NOPASSWD:ALL\nDefaults env_keep += "HOME"' >> /etc/sudoers

USER "$JEKYLL_USER"
ENV PATH="/home/$JEKYLL_USER/.local/bin:$PATH"

ENV MAKEFILE_DIR="/utils"
COPY ["Makefile", "$MAKEFILE_DIR/"]
WORKDIR "$MAKEFILE_DIR"

RUN sudo make ruby-install && \
    sudo make ruby-install/clean && \
    make ruby && \
    sudo make chruby && \
    sudo make chruby/profile.d && \
    sudo make chruby/clean && \
    make bundler