Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesk40 committed Apr 18, 2017
1 parent ed68f7f commit 0e64cdb
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
sudo: required
services:
- docker
language: java
jdk:
- oraclejdk8
Expand All @@ -16,9 +19,12 @@ before_install:
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
script: mvn install -DargLine="-Dlogback.configurationFile=src/test/resources/travis_logback.xml"
after_success:
- test "${TRAVIS_PULL_REQUEST}" == "false" && test "${TRAVIS_TAG}" != "" && ./travis/publish_to_bintray.sh && ./aws/create_aws_ami.sh
- test "${TRAVIS_PULL_REQUEST}" == "false" && test "${TRAVIS_TAG}" != "" && ./travis/publish_to_bintray.sh
&& ./aws/create_aws_ami.sh && ./docker/publish_docker.sh
env:
global:
- secure: fqS3OabyL+omMi6eCwajizY6uVq9sXVFmpECPtAfMNsTDh3mh4I2zo6puSZszMWp1+Oc9I1ZO1TvJjrrbEuhfuONT7SMd8U2L8jmtXXLwv1AKn/3IpmAF9PvU723hO9oO5SZDU79dRrlaEDRnoJHeJh1PG2j2vtCEGNZCZ2btNGP5g00yHcMjMUU5kSI113iuRMQLyZuT7WaoCJO8GXXJfTx37seiW4c77Kj+1J/icVhcx4eF/ZOQRXgGAkZo7sPcmuKmBb95eUjgx3guiK2M1pU+oaivaOp1Qm4mkVE9W9p7zYThmrTvIElFHXbGEI9ATDYC+lhi764hj9IIicKF4c6Nghtl6rlrazbJvxYPbyMbURjnVEmzUFn0hhq8vwwBsoqbxJ07Vn0IAoYaAWq0pP9wWUuTYq0yD/BsiFbek4ewwki2QXjr5ZpMFiRymnyn4dqcKXApHL6wDSMmJZ/9ZSadHkOF4b4T3exNd4h6JA6OioErstlPimPjsi7rtR2IkedOYwcYmUKsJ2Wn5fOfNxI6Rg9HfGr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qmZGHDeYZr4cKRpVeCLXTLPgjqmqs6mPahRk1x7+ExR24QHXOU=
- secure: 0ttLhXSKHPVtDJ7783naImEuv0TU+UOCZPufUFXkdny9hddISqHljFbjRCe00U44wznHsE8LU9w/ORcCmiAm/FbWlx4TThD6TJjfZUfL0uPkBrngIpjtZG2B6ThJXafcL0YopwZ9q//P4disG65jF/K7AV7gTaqDV3PW7HMvD3ZIU1LnsUaycqyCI6gtEgd9anOim3RFTpk2LqrqO0hQSxtojl67KLnYwO2JVBj1LYAqJWyWxiSOcNipRubVebmTT73g+1hxHb+H4aFhSjik0ugFatiiCOCYL6ejYrjo0qrfWWIErTbQKN8z/XcKaTTRsO0OhDYJ7UfeQdhm51nSL6Bf+FmhdDRGoSjJ48ypgHgP5UUxNcGzGhnoEO7SePC8jT5hC/6+JU4dwWlrqttZFUQWLH1DE2NQNkGqAfubHjpCWYWQSqzrek5MYbko24u3ahfIXvq4/3vh75QhjPCoUzi1WNcrmfr+B18XVG7/Sb9ewee03qRXALFTkYk4ZkTLCJ60WJN7MoP5mRn7gKkqRo/5rZKAAfDdfri2pyGVAikbY9QE14jnGOnUOJ36pVqGo9mAiS6ulzjD6+4FBVbwg5Ayv0eJ7XD3jWktZdxvtfr8fNBwdlAhF3mIqZ7tAP+ww4Mu0OevMHHVUzKCeWs0m6DkjQ8RRh5DrAYVygW9SXU=
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:latest
RUN mkdir -p /opt/athenz
COPY ./aws/start.sh /opt/athenz
COPY ./aws/stop.sh /opt/athenz

RUN apt-get update && apt-get -y install openjdk-8-jdk curl sudo && curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install -y nodejs && npm install -y -g nodemon

COPY ./assembly/zms/target/athenz-zms-*-bin.tar.gz /opt/athenz
COPY ./assembly/zts/target/athenz-zts-*-bin.tar.gz /opt/athenz
COPY ./assembly/ui/target/athenz-ui-*-bin.tar.gz /opt/athenz
COPY ./assembly/utils/target/athenz-utils-*-bin.tar.gz /opt/athenz

RUN cd /opt/athenz/ && tar xvfz athenz-zms*.tar.gz && tar xvfz athenz-zts*.tar.gz && tar xvfz athenz-ui*.tar.gz && tar xvfz athenz-utils*.tar.gz

EXPOSE 9443
EXPOSE 4443
EXPOSE 8443

CMD /opt/athenz/start.sh && tail -f /opt/athenz/athenz-ui-*/logs/ui/ui.out
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and often rely on network ACLs and manual updating.
* [ZTS Server](docs/setup_zts.md)
* [UI Server](docs/setup_ui.md)
* [Amazon AWS](docs/setup_aws.md)
* [Docker](docs/setup_docker.md)
* Production Environment Setup
* [ZMS Server](docs/setup_zms_prod.md)
* [ZTS Server](docs/setup_zts_prod.md)
Expand Down
6 changes: 6 additions & 0 deletions docker/publish_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ev

docker build -t athenz/athenz .
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push athenz/athenz
56 changes: 56 additions & 0 deletions docs/setup_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Setup Docker
-----------------

* [Requirements](#requirements)
* [docker](#docker)
* [Launch instance](#launch-instance)
* [Start/Stop Athenz](#startstop-athenz)

## Requirements
---------------

### docker
-----------

Please checkout https://docs.docker.com/engine/installation/ for docker installation.


## Launch instance
-------------------

Once you have installed docker, launch Athenz by executing the following docker command:

```shell
docker run -itd -P athenz/athenz
```

Once you have started the docker container, you can access Athenz via ports exposed by docker.

For accessing Athenz UI, open your browser with url https://localhost:32786

Internally, Athenz UI Server will be listening on port 9443. ZMS will be listening on port 4443 and ZTS will be on port 8443.

default login/password is athenz:athenz

```shell
amountblood-lm:athenz charlesk$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6cc857e7f97e athenz/athenz "/bin/sh -c '/opt/..." 6 minutes ago Up 2 seconds 0.0.0.0:32788->4443/tcp, 0.0.0.0:32787->8443/tcp, 0.0.0.0:32786->9443/tcp elegant_wozniak
```


## Start/Stop Athenz
-----------------------

run 'docker ps' to get the CONTAINER ID first.

```shell
amountblood-lm:athenz charlesk$ docker stop 6cc857e7f97e
```

To start Athenz, execute the following commands:

```shell
amountblood-lm:athenz charlesk$ docker start 6cc857e7f97e
```

0 comments on commit 0e64cdb

Please sign in to comment.