Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Niventill committed Jan 21, 2023
1 parent e3aa81a commit e0ebad5
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unofficial Docker image for Multi Theft Auto: San Andreas game server. Maintaine
- Total image size is oscillating around 100MiB
- **64-bit server only**
- On Windows, only the [**Docker Desktop with WSL 2 backend**](https://docs.docker.com/docker-for-windows/wsl/) is supported, so expect weird issues with different setup (been there, done that, big NOPE from me). On Linux there are no problems at all.
- The tags always reflect the specific version and build number of the MTA server which they contain, i.e. `1.5.7-20595-v4`
- The tags always reflect the specific version and build number of the MTA server which they contain, i.e. `1.5.9-21437-v1`


> **Note:** the `v4` in this example is the version number of the tag itself because sometimes something might go wrong and an updated release of the same version and build number is needed)
Expand Down Expand Up @@ -109,7 +109,7 @@ docker run --name mta-server \
-p 22005:22005 \
-v $(pwd)/mta-resources:/resources \ # mount mta resources dir
-v $(pwd)/data:/data \ # mount mta data dir (config, acl, banlist, internal DBs etc.)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

From powershell (basically the only difference is `pwd` syntax):
Expand All @@ -122,7 +122,7 @@ docker run --name mta-server \
-p 22005:22005 \
-v ${PWD}/mta-resources:/resources \ # mount mta resources dir
-v ${PWD}/data:/data \ # mount mta data dir (config, acl, banlist, internal DBs etc.)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

## More examples
Expand All @@ -139,7 +139,7 @@ docker run --name mta-server \
-p 22003:22003/udp \
-p 22005:22005 \
-v $(pwd)/mta-resources:/resources \
notfound/mtasa-server:1.5.7-20359-v17
notfound/mtasa-server:1.5.9-21437-v1
```

#### Or with access to /data (mtaserver.conf, acl.xml etc.)
Expand All @@ -151,7 +151,7 @@ docker run --name mta-server \
-p 22005:22005 \
-v $(pwd)/mta-resources:/resources \
-v $(pwd)/data:/data \
notfound/mtasa-server:1.5.7-20359-v17
notfound/mtasa-server:1.5.9-21437-v1
```

### Running as non-root user:
Expand All @@ -160,7 +160,7 @@ notfound/mtasa-server:1.5.7-20359-v17
docker run --name mta-server \
-u $(id -u):$(id -g) # set uid and gid of current user
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Running in the background (daemonized):
Expand All @@ -169,7 +169,7 @@ notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
docker run --name mta-server \
-d # detach
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Expose resource-cache to setup external fastdl server
Expand All @@ -178,7 +178,7 @@ notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
docker run --name mta-server \
-t \ # allocate tty (always required)
-v $(pwd)/resource-cache:/resource-cache \ # mount cache dir, you only need it if you have fastdl server setup
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Enforce server password on startup
Expand All @@ -188,7 +188,7 @@ docker run --name mta-server \
-e MTA_SERVER_PASSWORD=mypassword
-e MTA_SERVER_PASSWORD_REPLACE_POLICY=always # always update the <password> entry in the active server config with the value of MTA_SERVER_PASSWORD
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Set server password on startup, but only if it's not already set in the config
Expand All @@ -198,7 +198,7 @@ docker run --name mta-server \
-e MTA_SERVER_PASSWORD=mypassword
-e MTA_SERVER_PASSWORD_REPLACE_POLICY=when-empty # only update the <password> entry in the active server config if it's not already set
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

`when-empty` is the default policy, so this can be simplified to just:
Expand All @@ -207,7 +207,7 @@ notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag n
docker run --name mta-server \
-e MTA_SERVER_PASSWORD=mypassword
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Automatically clear server password on startup if it's set in the config
Expand All @@ -216,7 +216,7 @@ notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag n
docker run --name mta-server \
-e MTA_SERVER_PASSWORD_REPLACE_POLICY=unless-empty # only update the <password> entry in the active server config if it has some value
-t \ # allocate tty (always required)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```

### Use custom config file
Expand All @@ -230,7 +230,7 @@ docker run --name mta-server \
-e MTA_SERVER_CONFIG_FILE_NAME=mtaserver.mycustom.conf
-t \ # allocate tty (always required)
-v ${PWD}/data:/data \ # mount mta data dir (config, acl, banlist, internal DBs etc.)
notfound/mtasa-server:1.5.7-20359-v17 # remember to adjust the tag name
notfound/mtasa-server:1.5.9-21437-v1 # remember to adjust the tag name
```


Expand All @@ -243,14 +243,13 @@ To build the image manually I use this exact command:
From bash:

```
env MTA_SERVER_VERSION=1.5.7 MTA_SERVER_BUILD_NUMBER=20359 IMAGE_VERSION=7 \
docker build --build-arg MTA_SERVER_VERSION=${MTA_SERVER_VERSION} -t mtasa-server:${MTA_SERVER_VERSION}-${MTA_SERVER_BUILD_NUMBER}-v${IMAGE_VERSION} .
env MTA_SERVER_VERSION=1.5.9 MTA_SERVER_BUILD_NUMBER=21437 IMAGE_VERSION=1 \
docker build --build-arg MTA_SERVER_VERSION=${MTA_SERVER_VERSION} --build-arg MTA_SERVER_BUILD_NUMBER=${MTA_SERVER_BUILD_NUMBER} -t mtasa-server:${MTA_SERVER_VERSION}-${MTA_SERVER_BUILD_NUMBER}-v${IMAGE_VERSION} .
```

From powershell:

```
$env:MTA_SERVER_VERSION="1.5.7"; $env:MTA_SERVER_BUILD_NUMBER="20359"; $env:IMAGE_VERSION="7";
docker build --build-arg MTA_SERVER_VERSION=$env:MTA_SERVER_VERSION -t mtasa-server:$env:MTA_SERVER_VERSION-$env:MTA_SERVER_BUILD_NUMBER-v$env:IMAGE_VERSION .
$env:MTA_SERVER_VERSION="1.5.9"; $env:MTA_SERVER_BUILD_NUMBER="21437"; $env:IMAGE_VERSION="1";
docker build --build-arg MTA_SERVER_VERSION=$env:MTA_SERVER_VERSION --build-arg MTA_SERVER_BUILD_NUMBER=$env:MTA_SERVER_BUILD_NUMBER -t mtasa-server:$env:MTA_SERVER_VERSION-$env:MTA_SERVER_BUILD_NUMBER-v$env:IMAGE_VERSION .
```

0 comments on commit e0ebad5

Please sign in to comment.