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

Commit

Permalink
switched to a single RUN command with an optional 'GOVMOMI_CHECKOUT' ARG
Browse files Browse the repository at this point in the history
  • Loading branch information
dericcrago authored and mattclay committed Apr 17, 2018
1 parent f871e58 commit 0e67c58
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
make.sh
*
!requirements.txt
!flask_control.py
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
FROM golang:1.10.1-alpine3.7

RUN apk add --no-cache build-base git linux-headers python python-dev py-pip py-setuptools
ARG GOVMOMI_CHECKOUT=dee49fa3694c5aff05e4b340b0686772f65c1fe1

ADD requirements.txt /root/requirements.txt
RUN pip install -r /root/requirements.txt
ADD flask_control.py /root/flask_control.py

RUN go get -d github.com/vmware/govmomi && \
RUN apk add --no-cache build-base git linux-headers python python-dev py-pip py-setuptools && \
pip install -r /root/requirements.txt && \
go get -d github.com/vmware/govmomi && \
cd ${GOPATH}/src/github.com/vmware/govmomi && \
git checkout dee49fa3694c5aff05e4b340b0686772f65c1fe1 && \
go install github.com/vmware/govmomi/govc github.com/vmware/govmomi/vcsim
git checkout ${GOVMOMI_CHECKOUT} && \
go install github.com/vmware/govmomi/govc github.com/vmware/govmomi/vcsim && \
apk del build-base git linux-headers python-dev py-pip py-setuptools

ADD flask_control.py /root/flask_control.py

EXPOSE 5000 8989 443 80 8080
CMD ["/root/flask_control.py"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# vcenter-test-container
vCenter simulator container for testing.

## Usage ##

### Building the image locally ###

```bash
docker image build -t local/ansible/vcenter-test-container:latest .
```

### Building the image locally with a different version of govmomi checked out ###

```bash
docker image build --build-arg GOVMOMI_CHECKOUT=<hash|branch|tag> -t local/ansible/vcenter-test-container:<hash|branch|tag> .
```
3 changes: 0 additions & 3 deletions make.sh

This file was deleted.

0 comments on commit 0e67c58

Please sign in to comment.