-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
executable file
·102 lines (83 loc) · 2.95 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
94
95
96
97
98
99
100
101
102
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
ARG TIMEZONE=Canada/Pacific
ARG USER_ID=1000
ARG GROUP_ID=1001
RUN apt update && apt install -y \
ansible \
build-essential \
curl \
git \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libssl-dev \
libffi-dev \
libsqlite3-dev \
make \
python3.8 \
python3-pip \
python3-dev \
python3-venv \
software-properties-common \
sudo \
unzip \
vim \
wget \
zlib1g-dev \
zsh
# Postgres
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt update \
&& apt install -y postgresql libpq-dev
# Prep for yarn install
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# apt-add-repository --yes --update ppa:ansible/ansible
RUN echo $TIMEZONE > /etc/timezone
RUN groupadd -r -g $GROUP_ID jubuntu
RUN useradd -rm -d /home/jubuntu -s /bin/bash -g root -G jubuntu -u $USER_ID jubuntu
RUN usermod -aG sudo jubuntu
RUN echo "jubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
COPY ./setup/.bash_functions /home/jubuntu/.bash_functions/
RUN chmod -R g+rwx /home/jubuntu/.bash_functions
# Salesforce sfdx
RUN wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
RUN mkdir sfdx
RUN tar xJf sfdx-linux-amd64.tar.xz -C sfdx --strip-components 1 && ./sfdx/install
COPY ./setup/rbenv_rails.sh /home/jubuntu/setup/
COPY ./setup/Gemfile /home/jubuntu/setup/sample-rails/
RUN chmod -R g+rwx /home/jubuntu/setup
USER jubuntu
RUN mkdir /home/jubuntu/.ssh
# rbenv, ruby, rails, global gems
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
RUN ["/bin/bash", "-c", "/home/jubuntu/setup/rbenv_rails.sh"]
USER root
COPY ./setup/nvm.sh /home/jubuntu/setup/
RUN chmod -R g+rwx /home/jubuntu/setup
USER jubuntu
# nvm, node, yarn, global packages
ENV XDG_CONFIG_HOME /home/jubuntu
RUN ["zsh", "-c", "/home/jubuntu/setup/nvm.sh"]
# install go
USER root
RUN curl -O https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go1.15.2.linux-amd64.tar.gz
# install ngrok
RUN curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -o ngrok.zip \
&& unzip ngrok.zip
COPY ./setup/.zshrc /home/jubuntu/.zshrc
RUN chmod g+rwx /home/jubuntu/.zshrc
USER jubuntu
WORKDIR /home/jubuntu
RUN mkdir -p /home/jubuntu/.local/bin
RUN curl https://releases.hashicorp.com/terraform/0.13.5/terraform_0.13.5_linux_amd64.zip -o terraform.zip \
&& unzip terraform.zip \
&& mv terraform /home/jubuntu/.local/bin
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip \
&& unzip awscliv2.zip \
&& sudo ./aws/install
WORKDIR /home/jubuntu/workdir
CMD ["zsh"]