-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (56 loc) · 2.12 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ubuntu:latest
ENV TZ="America/New_York"
ARG DEBIAN_FRONTEND="noninteractive"
ARG GITHUB_ACCESS_TOKEN="none"
ARG SSH_PRIVATE_KEY
ARG USER_NAME
ARG USER_ID
ENV SHELL=/bin/bash
ENV ARCH_STRING="arm64"
ENV ARCH_STRING_SECONDARY="aarch64"
ENV TERM=xterm-256color
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
RUN apt-get update
RUN apt-get install -y tzdata
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
RUN dpkg-reconfigure --frontend noninteractive tzdata
RUN apt-get install -y sudo openssh-client git
RUN useradd -ms /bin/bash -u $USER_ID $USER_NAME
RUN usermod -aG sudo $USER_NAME
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN groupadd docker
RUN sudo usermod -aG docker $USER_NAME
RUN newgrp docker
RUN mkdir /setup && chown $USER_NAME /setup
RUN mkdir /home/$USER_NAME/.tmux && chown $USER_NAME /home/$USER_NAME/.tmux
USER $USER_NAME
ENV USER=$USER_NAME
RUN mkdir /home/$USER_NAME/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /home/$USER_NAME/.ssh/id_rsa
RUN chmod 600 /home/$USER_NAME/.ssh/id_rsa
RUN eval `ssh-agent -s` && ssh-add /home/$USER_NAME/.ssh/id_rsa
RUN ssh-keyscan github.com >> /home/$USER_NAME/.ssh/known_hosts
WORKDIR /devbox-init
ARG FAIRWINDS_SETUP
COPY --chown=$USER_NAME ./dotfiles/.tool-versions ./dotfiles/.tool-versions
COPY --chown=$USER_NAME ./dotfiles/bashrc.d/151.node.sh ./dotfiles/bashrc.d/151.node.sh
COPY --chown=$USER_NAME ./setup/installers.sh ./setup/installers.sh
RUN ./setup/installers.sh
COPY --chown=$USER_NAME ./setup/languages.sh ./setup/languages.sh
RUN ./setup/languages.sh
COPY --chown=$USER_NAME ./setup/utils.sh ./setup/utils.sh
RUN ./setup/utils.sh
COPY --chown=$USER_NAME ./setup/git.sh ./setup/git.sh
RUN ./setup/git.sh
COPY --chown=$USER_NAME ./setup/vim.sh ./setup/vim.sh
RUN ./setup/vim.sh
COPY --chown=$USER_NAME ./setup/ops.sh ./setup/ops.sh
RUN ./setup/ops.sh
COPY --chown=$USER_NAME ./dotfiles ./dotfiles
COPY --chown=$USER_NAME ./setup/dotfiles.sh ./setup/dotfiles.sh
RUN ./setup/dotfiles.sh
COPY --chown=$USER_NAME ./astronvim /home/$USER_NAME/.config/nvim/lua/user
RUN rm /home/$USER_NAME/.ssh/id_rsa
WORKDIR /home/$USER_NAME
CMD sudo chown $USER /var/run/docker.sock && tmux -u