blob: 0c04759eb3b5bd510405a2d9e4e42c6e57507638 [file] [log] [blame]
Sergio Slobodrianab11c642017-04-24 07:16:58 -04001# Copyright 2016 the original author or authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
David K. Bainbridge12463052018-01-19 09:26:09 -080014ARG TAG=latest
Sergio Slobodrianab11c642017-04-24 07:16:58 -040015
David K. Bainbridge12463052018-01-19 09:26:09 -080016FROM voltha/voltha-base:${TAG}
Sergio Slobodrianab11c642017-04-24 07:16:58 -040017
18MAINTAINER Sergio Slobodrian <sslobodr@ciena.com>
19
20# Bundle app source
21RUN mkdir /cli && touch /cli/__init__.py
22ENV PYTHONPATH=/cli
23COPY common /cli/common
24COPY cli /cli/cli
25COPY voltha /cli/voltha
26RUN useradd -b /home -d /home/voltha voltha -s /bin/bash
27RUN mkdir /home/voltha
28RUN chown voltha.voltha /home/voltha
29RUN echo "voltha:admin" | chpasswd
30RUN apt-get update && apt-get install -y openssh-server
31RUN apt-get update && apt-get install -y openssh-server
32RUN mkdir /var/run/sshd
33RUN echo 'root:screencast' | chpasswd
34RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
35
36# SSH login fix. Otherwise user is kicked off after login
37RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
38
39ENV NOTVISIBLE "in users profile"
40RUN echo "export VISIBLE=now" >> /etc/profile
41
42EXPOSE 22
43
44# Exposing process and default entry point
45ENTRYPOINT ["/usr/bin/dumb-init", "--"]
46
47CMD ["/cli/cli/setup.sh"]