-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
108 lines (85 loc) · 2.58 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
103
104
105
106
107
108
# cip
#
#VERSION 0.0.1
FROM ubuntu:14.04
MAINTAINER Lukas Svoboda "lukas.svoboda@gmail.com"
RUN export DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN apt-get update -qq && apt-get upgrade -y
RUN apt-get install -y --force-yes \
autoconf \
bind9-host \
bison \
build-essential \
coreutils \
ca-certificates \
curl \
daemontools \
dnsutils \
ed \
git \
imagemagick \
iputils-tracepath \
language-pack-en \
libbz2-dev \
libcurl4-openssl-dev \
libevent-dev \
libglib2.0-dev \
libjpeg-dev \
libmagickwand-dev \
libmysqlclient-dev \
libncurses5-dev \
libpq-dev \
libpq5 \
libreadline6-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
netcat-openbsd \
openjdk-7-jdk \
openjdk-7-jre-headless \
openssh-client \
openssh-server \
postgresql-server-dev-9.3 \
python \
python-dev \
ruby \
ruby-dev \
socat \
syslinux \
tar \
telnet \
zip \
zlib1g-dev \
-
RUN mkdir /var/run/sshd
RUN sudo chmod -rx /var/run/sshd
RUN sudo chown root:root /etc/ssh/sshd_config
EXPOSE 22
RUN sudo sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config && \
sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config && \
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN useradd --shell /bin/sh --create-home vagrant -s /bin/bash
RUN echo 'vagrant:vagrant' | chpasswd
RUN sudo usermod -a -G sudo vagrant
ADD id_rsa.pub /home/vagrant/.ssh/authorized_keys
RUN chmod 700 /home/vagrant/.ssh && \
chown vagrant.vagrant /home/vagrant/.ssh && \
chmod 600 /home/vagrant/.ssh/authorized_keys && \
chown vagrant.vagrant /home/vagrant/.ssh/authorized_keys
RUN echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
ADD scripts/ /tmp/chef
RUN sudo apt-get -y -qq install bash openssl vim wget
RUN sudo git config --global url."https://github.com".insteadOf git://github.com
RUN curl -L https://www.opscode.com/chef/install.sh | sudo bash -s -- -v 11.16.2-1
RUN mkdir -p /tmp/chef/travis-cookbook/assets/cache
RUN cd /tmp/chef/travis-cookbook && sudo chef-solo -c /tmp/chef/solo.rb -j /tmp/chef/standard_solo.json
CMD ["/usr/sbin/sshd", "-D"]
#ADD start.sh /start.sh
#RUN chmod 0755 /start.sh
#CMD /start.sh