-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (76 loc) · 2.64 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM alpine:latest
ARG GITHUB_USERNAME
ARG DEV_DIR
# Install base toolchain
RUN apk update && \
apk add --no-cache \
ack \
asciinema \
bash \
coreutils \
curl \
docker \
docker-compose \
git \
gnupg \
hugo \
jq \
libc6-compat \
mandoc man-pages mdocml less less-doc \
openssh-client \
py-crcmod \
python3 \
py3-pip \
sudo \
tmux \
vim \
zsh
RUN mkdir -p /Users && \
sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers && \
adduser -S $GITHUB_USERNAME -G root -h /Users/$GITHUB_USERNAME && \
addgroup $GITHUB_USERNAME wheel && \
addgroup $GITHUB_USERNAME docker
# Install ngrok
RUN curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -o /tmp/ngrok.zip && \
unzip /tmp/ngrok.zip -d /usr/local/bin && \
rm /tmp/ngrok.zip
# Install shellcheck
ARG SC_VERSION=stable
RUN wget -qO- "https://storage.googleapis.com/shellcheck/shellcheck-${SC_VERSION}.linux.x86_64.tar.xz" | tar -xJv && \
cp "shellcheck-${SC_VERSION}/shellcheck" /usr/local/bin/
# Install Google Cloud SDK
ARG CLOUD_SDK_VERSION=338.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH /google-cloud-sdk/bin:$PATH
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true
# Install AWS CLI
RUN pip3 install --upgrade pip && \
pip3 install \
awscli
# Install denv
COPY bin/denv /usr/local/bin
WORKDIR /Users/$GITHUB_USERNAME
USER $GITHUB_USERNAME
# Configure tmux
COPY tmux.conf .tmux.conf
# Configure zsh/oh-my-zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
COPY zshrc .zshrc
# Configure vim
RUN git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
COPY vimrc .vimrc
RUN echo | echo | vim +PluginInstall +qall &>/dev/null
ENV GITHUB_USERNAME $GITHUB_USERNAME
ENV HOME /Users/$GITHUB_USERNAME
ENV DEV_DIR $DEV_DIR
RUN mkdir -p /Users/$GITHUB_USERNAME/.local && \
chown -R $GITHUB_USERNAME /Users/$GITHUB_USERNAME/.local
ENV SHELL /bin/zsh
VOLUME /Users/$GITHUB_USERNAME/.local
WORKDIR /Users/$GITHUB_USERNAME/$DEV_DIR
CMD ["/bin/zsh"]