-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (62 loc) · 1.59 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
FROM ubuntu:trusty
MAINTAINER Andreas Böhrnsen <andreas@frontrunner.io>
ENV DEV_USERNAME frontrunner
# Disable root password
RUN passwd -l root
# Create user and give sudo
RUN \
/bin/bash -c '\
useradd --create-home -s /bin/bash $DEV_USERNAME && \
adduser $DEV_USERNAME sudo && \
mkdir -p /etc/sudoers.d && \
echo $DEV_USERNAME ALL=NOPASSWD:ALL > /etc/sudoers.d/$DEV_USERNAME && \
chmod 0440 /etc/sudoers.d/$DEV_USERNAME \
'
# Install essential tools
RUN \
apt-get update && \
apt-get install -yy --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
git \
libpq-dev \
libssl-dev \
libreadline-dev \
zlib1g-dev && \
apt-get clean
# Install nvm and rbenv in user space
USER $DEV_USERNAME
# install nvm
RUN \
/bin/bash -c '\
git clone https://github.com/creationix/nvm.git ~/.nvm && \
cd ~/.nvm && git checkout v0.29.0 && \
echo "# nvm" >> ~/.bashrc && \
echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.bashrc && \
echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"" >> ~/.bashrc \
'
# Install rbenv
RUN \
/bin/bash -c '\
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv && \
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \
echo "# rbenv" >> ~/.bashrc && \
echo "export PATH=\"\$HOME/.rbenv/bin:\$PATH\"" >> ~/.bashrc && \
echo "eval \"\$(rbenv init -)\"" >> ~/.bashrc \
'
USER root
# Install dev tools
RUN \
apt-get update && \
apt-get install -yy --no-install-recommends \
curl \
git \
silversearcher-ag \
tig \
tmux \
vim-nox \
wget \
zsh && \
apt-get clean