-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
46 lines (35 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
44
45
# Use Ubuntu LTS
FROM ubuntu:groovy
# Set build environment variables.
ENV DOCKERIZED true
ENV USER poom
ENV TIMEZONE "Asia/Bangkok"
ARG DEBIAN_FRONTEND=noninteractive
# Setup time zones and install linux dependencies needed for build.
RUN ln -snf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime \
&& echo $TIMEZONE > /etc/timezones \
&& apt update && apt install -y sudo curl \
&& apt clean
# Adds a new user to the sudo group
RUN useradd -ms /bin/bash $USER && \
usermod -a -G sudo $USER && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Install essential linux dependencies.
COPY ./setup/linux/deps /tmp/deps
RUN /tmp/deps/install.sh
# Assume the user.
USER $USER
ENV USER_HOME /home/$USER
WORKDIR $USER_HOME
# Setup the chezmoi directory.
ENV CHEZMOI_HOME $USER_HOME/.local/share/chezmoi
# Install chezmoi binary.
RUN mkdir -p $CHEZMOI_HOME \
&& mkdir -p $USER_HOME/bin \
&& sh -c "$(curl -fsLS git.io/chezmoi)"
# Copy the dotfiles.
COPY . $CHEZMOI_HOME
# Apply chezmoi source state and configuration.
RUN $USER_HOME/bin/chezmoi init --apply
# Start fish shell.
CMD fish