forked from CloudPadovana/caos-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.vagrant
67 lines (56 loc) · 2.14 KB
/
Dockerfile.vagrant
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
######################################################################
#
# caos-dashboard - CAOS dashboard
#
# Copyright © 2016, 2017 INFN - Istituto Nazionale di Fisica Nucleare (Italy)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Fabrizio Chiarello <[email protected]>
#
######################################################################
FROM buildpack-deps:stretch
LABEL maintainer "Fabrizio Chiarello <[email protected]>"
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
apt-transport-https \
apt-utils \
build-essential \
curl \
dnsutils \
git \
lsb-release \
net-tools \
openssh-server \
sudo \
vim
# change root password
RUN echo "root:vagrant" | chpasswd
# setup SSH
RUN mkdir /var/run/sshd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
EXPOSE 22
# setup Vagrant user
RUN groupadd --gid 1000 vagrant && \
useradd --uid 1000 --gid vagrant --shell /bin/bash --create-home vagrant
RUN echo "vagrant:vagrant" | chpasswd
# setup SUDO
RUN echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN echo "cd /vagrant" >> /home/vagrant/.profile
ENV LANG=C.UTF-8
# Based on https://github.com/moby/moby/issues/2569#issuecomment-27973910
CMD ["/bin/sh", "-c", "env | grep '^LANG\\|_' >> /etc/environment && /usr/sbin/sshd -D"]
ARG CAOS_DASHBOARD_FORCE_DOCKER_CACHE_MISS