Skip to content

Commit

Permalink
Move to use Ubuntu 18.04. No more tricks with pip and openstack clients.
Browse files Browse the repository at this point in the history
Use ubuntu user in the Docker as good secu practice
  • Loading branch information
thomnico committed Sep 4, 2018
1 parent 5032e26 commit f46217e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
#build cmd:
# docker build --force-rm -t fortistacks-cli:1.2 .
# docker build --force-rm -t fortistacks-cli .
FROM ubuntu:16.04
MAINTAINER Nicolas Thomas <thomnico@gmail.com>
FROM ubuntu:18.04
MAINTAINER Nicolas Thomas <nthomas@fortinet.com>
#Update the Ubuntu software repository inside the dockerfile with the 'RUN' command.
# Update Ubuntu Software repository
RUN apt update && apt -y upgrade && apt -y install git python-pip wget zile byobu bash sudo python-virtualenv wget git cloud-image-utils
RUN pip install --upgrade pip && pip install python-novaclient==9.1.1 python-openstackclient python-heatclient
RUN apt-get update && apt-get -y upgrade
ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y install git python-pip wget zile byobu bash sudo python-virtualenv wget git cloud-image-utils python-openstackclient sudo
RUN apt clean

RUN groupadd -r ubuntu && useradd -g ubuntu -G adm,sudo ubuntu -m -p fortinet && \
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-nopasswd && chmod 640 /etc/sudoers.d/99-nopasswd
USER ubuntu
CMD ["/bin/bash"]
4 changes: 2 additions & 2 deletions README-DockerClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Copy your .rc file with the openstack credentials in fortistacks folder.

From fortistacks folder:
```shell
docker run -v $PWD:/fortistacks/ -v $HOME/.ssh:/root/.ssh/ --rm -i --name fortistacks-cli -h fortistacks-cli -t thomnico/fortinet-cse:fortistacks-cli-1.2
docker run -v $PWD:/fortistacks/ -v $HOME/.ssh:/home/ubuntu/.ssh/ --rm -i --name fortistacks-cli -h fortistacks-cli -t thomnico/fortinet-cse:fortistacks-cli-1.3
```
Or adapt to your folder layout.

Expand All @@ -27,6 +27,6 @@ Check Dockerfile in this folder to see how it is done.
Have to use pinpoint version due to weeks long bugs in openstack clients.

```shell
$ docker run -v $PWD:/fortistacks/ -v $HOME/.ssh:/root/.ssh/ --rm -i --name fortistacks-cli -h fortistacks-cli -t fortistacks-cli:1.2
$ docker run -v $PWD:/fortistacks/ -v $HOME/.ssh:/home/ubuntu/.ssh/ --rm -i --name fortistacks-cli -h fortistacks-cli -t fortistacks-cli:1.3
```

0 comments on commit f46217e

Please sign in to comment.