Fix documentation, remove sudo from docker-compose up (issue #48)

This commit is contained in:
allegroai 2020-07-06 22:07:59 +03:00
parent aa22170ab4
commit 8678091d8f

View File

@ -1,6 +1,6 @@
# Launching the **trains-server** Docker in Linux or macOS # Launching the **trains-server** Docker in Linux or macOS
For Linux or macOS, use our pre-built Docker image for easy deployment. The latest Docker images can be found [here](https://hub.docker.com/r/allegroai/trains). For Linux or macOS, use our pre-built Docker image for easy deployment. The latest Docker images can be found [here](https://hub.docker.com/r/allegroai/trains).
For Linux users: For Linux users:
@ -16,20 +16,20 @@ To launch **trains-server** on Linux or macOS:
1. Verify the Docker CE installation. Execute the command: 1. Verify the Docker CE installation. Execute the command:
sudo docker run hello-world docker run hello-world
The expected is output is: The expected is output is:
Hello from Docker! Hello from Docker!
This message shows that your installation appears to be working correctly. This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64)
3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
1. For Linux only, install `docker-compose`. Execute the following commands (for more information, see [Install Docker Compose](https://docs.docker.com/compose/install/) in the Docker documentation): 1. For Linux only, install `docker-compose`. Execute the following commands (for more information, see [Install Docker Compose](https://docs.docker.com/compose/install/) in the Docker documentation):
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
@ -42,12 +42,12 @@ To launch **trains-server** on Linux or macOS:
sudo mv /tmp/99-trains.conf /etc/sysctl.d/99-trains.conf sudo mv /tmp/99-trains.conf /etc/sysctl.d/99-trains.conf
sudo sysctl -w vm.max_map_count=262144 sudo sysctl -w vm.max_map_count=262144
sudo service docker restart sudo service docker restart
macOS: macOS:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
sysctl -w vm.max_map_count=262144 sysctl -w vm.max_map_count=262144
1. Remove any previous installation of **trains-server**. 1. Remove any previous installation of **trains-server**.
@ -64,28 +64,28 @@ To launch **trains-server** on Linux or macOS:
sudo mkdir -p /opt/trains/logs sudo mkdir -p /opt/trains/logs
sudo mkdir -p /opt/trains/config sudo mkdir -p /opt/trains/config
sudo mkdir -p /opt/trains/data/fileserver sudo mkdir -p /opt/trains/data/fileserver
1. For macOS only, open the Docker app, select **Preferences**, and then on the **File Sharing** tab, add `/opt/trains`. 1. For macOS only, open the Docker app, select **Preferences**, and then on the **File Sharing** tab, add `/opt/trains`.
1. Grant access to the Dockers. 1. Grant access to the Dockers.
Linux: Linux:
sudo chown -R 1000:1000 /opt/trains sudo chown -R 1000:1000 /opt/trains
macOS: macOS:
sudo chown -R $(whoami):staff /opt/trains sudo chown -R $(whoami):staff /opt/trains
1. Download the **trains-server** docker-compose YAML file. 1. Download the **trains-server** docker-compose YAML file.
cd /opt/trains cd /opt/trains
curl https://raw.githubusercontent.com/allegroai/trains-server/master/docker-compose.yml -o docker-compose.yml curl https://raw.githubusercontent.com/allegroai/trains-server/master/docker-compose.yml -o docker-compose.yml
1. Run `docker-compose` with the downloaded configuration file. 1. Run `docker-compose` with the downloaded configuration file.
sudo docker-compose -f docker-compose.yml up docker-compose -f docker-compose.yml up
Your server is now running on [http://localhost:8080](http://localhost:8080) and the following ports are available: Your server is now running on [http://localhost:8080](http://localhost:8080) and the following ports are available:
* Web server on port `8080` * Web server on port `8080`
@ -94,4 +94,4 @@ To launch **trains-server** on Linux or macOS:
## Next Step ## Next Step
Configure the [Trains client for trains-server](https://github.com/allegroai/trains/blob/master/README.md#configuration). Configure the [Trains client for trains-server](https://github.com/allegroai/trains/blob/master/README.md#configuration).