Files
dotfiles/Dockerfile
2020-03-25 19:57:24 +00:00

28 lines
734 B
Docker

from ubuntu:bionic as install
# Install sudo and make, git since built-in is skipped
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get -qqy update \
&& apt-get -qqy install sudo git make
# Create user with sudo priviledge
ARG USER="test-user"
RUN useradd --create-home -m "$USER" \
&& adduser "$USER" sudo
RUN echo "$USER ALL=(ALL) NOPASSWD: ALL" \
>>/etc/sudoers
# Filesystem steps
ENV WORKSPACE="/home/$USER/workspace"
ADD --chown=test-user . "$WORKSPACE/dotfiles"
WORKDIR "$WORKSPACE/dotfiles"
# Install steps
USER test-user
ENV FAST_MODE="true"
ARG TARGET="all"
RUN make TARGET=$TARGET
# Test entrypoint
ENTRYPOINT [ "make", "--directory", "tests", "TARGET=$TARGET" ]