https://github.com/levankhelo/robocode
Containerized: Robocode
https://github.com/levankhelo/robocode
containerized containers docker docker-image game java robocode socat
Last synced: about 1 month ago
JSON representation
Containerized: Robocode
- Host: GitHub
- URL: https://github.com/levankhelo/robocode
- Owner: levankhelo
- License: mit
- Created: 2021-05-21T21:45:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-30T19:06:56.000Z (over 3 years ago)
- Last Synced: 2025-01-10T14:53:17.615Z (9 months ago)
- Topics: containerized, containers, docker, docker-image, game, java, robocode, socat
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prerequisites
## MacOS
We will need to get `xhost` and `socat` to run GUI display from container## TL;DR
```bash
if ! command -v xquartz > /dev/null; then brew install xquartz; else echo "Xquartz already installed"; fiif ! command -v socat > /dev/null; then brew install socat; else echo "SOCAT already installed"; fi
osascript -e 'tell application "Terminal" to do script "socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\\\"$DISPLAY\\\""'
export ROBOCODE_LOCAL_IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
docker-compose up --build
```
### Install X11
```bash
brew install xquartz;
```
After installation, Open up *xquartz* using command `xquartz` or icon click, then:
`XQUARTZ` > `Preferences` > `Security` > `Allow connections from network clients` > `✅ (check)`
### Install SOCAT
```bash
brew install socat;
```### Run Socat
```bash
osascript -e 'tell application "Terminal" to do script "socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\""'
```### Configure variables for container
```bash
export ROBOCODE-LOCAL-IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
```
### Build Docker image
Make sure docker service is running
```bash
docker-compose build
```### Run docker image
```bash
docker-compose up
```> or `docker-compose up --build`