-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (32 loc) · 1.08 KB
/
Dockerfile
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
ARG BASE_IMAGE=ubuntu:22.04
# ========================================
# Base environment
# ========================================
FROM ${BASE_IMAGE} as base
# Avoid the following error:
# curl: (77) error setting certificate file: /etc/ssl/certs/ca-certificates.crt
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates
# Install minimum requirements
RUN apt-get install -y --no-install-recommends \
sudo \
git \
wget \
curl
ARG USERNAME=pragmaticivan
ARG USER_UID=1000
ARG USER_GID=${USER_UID}
RUN groupadd --gid ${USER_GID} ${USERNAME} \
&& useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} -G sudo -s /bin/bash \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& echo 'Defaults verifypw = any' >> /etc/sudoers
USER ${USERNAME}
WORKDIR /home/${USERNAME}
FROM base as dev
# Install chezmoi
RUN sudo sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin
# Install requirements for testing
RUN sudo apt-get install -y --no-install-recommends \
bats \
kcov
WORKDIR /home/${USERNAME}/.local/share/chezmoi