1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
15 LABEL Description="CSIT vpp-device ubuntu 18.04 shim image"
16 LABEL Version="master"
18 # Setup the environment
19 ENV DEBIAN_FRONTEND=noninteractive
20 ENV NOTVISIBLE "in users profile"
21 RUN echo "export VISIBLE=now" >> /etc/profile
23 ADD files/wrapdocker /usr/local/bin/wrapdocker
24 RUN chmod +x /usr/local/bin/wrapdocker
26 # Install packages and Docker
27 RUN apt-get -q update \
28 && apt-get install -y -qq \
37 && curl -fsSL https://get.docker.com | sh \
38 && rm -rf /var/lib/apt/lists/*
43 RUN mkdir /var/run/sshd
44 RUN echo 'root:Csit1234' | chpasswd
45 RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
47 # SSH login fix. Otherwise user is kicked off after login
48 RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
50 # Need volume for sidecar docker launches
51 VOLUME /var/lib/docker
53 # SSH to listen on port 6022 in shim
54 RUN echo 'Port 6022' >>/etc/ssh/sshd_config
55 RUN echo 'Port 6023' >>/etc/ssh/sshd_config
56 ADD files/badkeypub /root/.ssh/authorized_keys
57 ADD files/sshconfig /root/.ssh/config
59 # Start sshd by default
61 CMD ["/usr/sbin/sshd", "-D"]