Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile for version 1.6.0 and a README.md for Docker usage #16

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM java:8
MAINTAINER Mael Auzias <the-one@mael.auzias.net>
LABEL Description="This image is used to run the ONE simulator lastest version"

RUN mkdir /home/one \
&& useradd one

RUN curl -sL https://codeload.github.com/akeranen/the-one/legacy.tar.gz/master \
| tar xvz \
&& mv akeranen-the-one-* /home/one/the-one_latest \
&& cd /home/one/the-one_latest \
&& ./compile.sh \
&& chown -R one:one /home/one

WORKDIR /home/one/the-one_lastest
USER one

ENTRYPOINT ["./one.sh"]
12 changes: 12 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Why a Docker image for a java app?
So you do not need to install `java` nor play around with different versions. [See more reasons](https://stackoverflow.com/questions/34487094/why-use-docker-arent-java-files-like-war-files-already-running-on-jvm).

### How to build an `$version` image?
To build the version `1.6.0`, from this directory execute:

docker build -t theone:latest .

### How to run it with the GUI and share conf/data files?
You just need to share the socket `/tmp/.X11-unix` and the variable `DISPLAY` for the GUI, as for the conf/data files, assuming that these ones are in `/path/to/theone/data/files` just execute:

docker run --rm -it -e DISPLAY=$DISPLAY -v /path/to/theone/data/files:/one -v /tmp/.X11-unix:/tmp/.X11-unix theone:latest