-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.arch
More file actions
56 lines (46 loc) · 1.17 KB
/
Dockerfile.arch
File metadata and controls
56 lines (46 loc) · 1.17 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# arch-base: Base Arch image with sudo user
#
FROM archlinux:base AS base
# Install required packages
RUN pacman -Sy --noconfirm && \
pacman -S --noconfirm --needed \
base-devel \
sudo \
curl \
gnupg \
openssh \
wget && \
pacman -Scc --noconfirm
# Create user with sudo privilege
RUN useradd -r -u 1001 --create-home -m "test-user" && \
echo "test-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
#
# source: Base image with source copied over
#
FROM base AS source
ARG DOTFILES_DIR="/workdir/.dotfiles"
RUN mkdir -p "$DOTFILES_DIR" && \
chown -R "test-user" "$DOTFILES_DIR"
ADD --chown="test-user" home "$DOTFILES_DIR/home"
ADD --chown="test-user" install.d "$DOTFILES_DIR/install.d"
ADD --chown="test-user" script "$DOTFILES_DIR/script"
WORKDIR "$DOTFILES_DIR"
#
# install: Installation steps
#
FROM source AS install
ENV USER=test-user
ENV SKIP_SUDO_CHECK=true
ENV SKIP_SSH_CONFIG=true
ENV SKIP_DOCKER_CONFIG=true
USER test-user
ARG UUID="docker"
RUN ./script/install
#
# test: Test entrypoint
#
FROM install AS test
ADD --chown="test-user" tests "$DOTFILES_DIR/tests"
WORKDIR "$DOTFILES_DIR/tests"
ENTRYPOINT [ "./run.sh" ]