Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
updated ansible/ansible:vcenter-simulator Dockerfile to golang base
Browse files Browse the repository at this point in the history
also added exact versions of govmomi (specific hash) and python packages (requirements.txt)

this continues to use vcsim from commit dee49fa on Oct 13, 2017
  • Loading branch information
dericcrago authored and mattclay committed Apr 16, 2018
1 parent a1f1aa7 commit 9fcf25c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 32 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make.sh
33 changes: 5 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
FROM fedora:26
FROM golang:1.10.1

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*; \
rm -f /etc/systemd/system/*.wants/*; \
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*; \
rm -f /lib/systemd/system/anaconda.target.wants/*;
RUN apt-get update && \
apt-get -y --no-install-recommends install python-dev python-pip python-setuptools python-wheel && \
rm -rf /var/lib/apt/lists/*

RUN dnf clean all && \
dnf -y --setopt=install_weak_deps=false install \
git \
glibc \
gcc \
golang-bin \
python-devel \
python-pip \
python-setuptools \
redhat-rpm-config \
yum \
&& \
dnf clean all

VOLUME /sys/fs/cgroup /run /tmp
ENV container=docker
RUN mkdir -p /opt/gocode
RUN chmod -R 777 /opt/gocode
ENV GOPATH=/opt/gocode
ADD requirements.txt /root/requirements.txt
RUN pip install -r /root/requirements.txt
ADD flask_control.py /root/flask_control.py
Expand All @@ -38,4 +14,5 @@ RUN go get -d github.com/vmware/govmomi && \
go install github.com/vmware/govmomi/govc github.com/vmware/govmomi/vcsim

EXPOSE 5000 8989 443 80 8080

CMD ["/root/flask_control.py"]
2 changes: 1 addition & 1 deletion flask_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


app = Flask(__name__)
GOPATH = os.path.expanduser('/opt/gocode')
GOPATH = os.path.abspath(os.environ['GOPATH'])
VCSIMPATH = os.path.join(GOPATH, 'bin', 'vcsim')
GOVCPATH = os.path.join(GOPATH, 'bin', 'govc')
GOVCURL = None
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
click==6.7
Flask==0.12.2
itsdangerous==0.24
Jinja2==2.9.6
Jinja2==2.10
MarkupSafe==1.0
psutil==5.4.0
Werkzeug==0.12.2
psutil==5.4.5
Werkzeug==0.14.1

0 comments on commit 9fcf25c

Please sign in to comment.