Auto-merging via docker-versions-create

This commit is contained in:
Geoff Bourne
2021-01-29 21:04:06 -06:00
6 changed files with 84 additions and 24 deletions
+2
View File
@@ -15,6 +15,7 @@ on:
tags: tags:
- "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-openj9" - "[0-9]+.[0-9]+.[0-9]+-openj9"
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly" - "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
- "[0-9]+.[0-9]+.[0-9]+-adopt11" - "[0-9]+.[0-9]+.[0-9]+-adopt11"
- "[0-9]+.[0-9]+.[0-9]+-adopt13" - "[0-9]+.[0-9]+.[0-9]+-adopt13"
@@ -69,6 +70,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }} key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}- ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
${{ runner.os }}-buildx-
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
+28 -2
View File
@@ -116,8 +116,24 @@ to map a directory on your host machine to the container's `/data` directory, su
docker run -d -v /path/on/host:/data ... docker run -d -v /path/on/host:/data ...
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` and start the server again with `docker start CONTAINER_ID` to pick up the new configuration.
and start the server again with `docker start CONTAINERID` to pick up the new configuration.
As example, using Docker compose, create the following `docker-compose.yml` in its own directory and the container will automatically create/attach the relative directory `data` to the container:
```yaml
version: "3"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
volumes:
# attach the relative directory 'data' to the container's /data path
./data:/data
```
## Versions ## Versions
@@ -753,12 +769,18 @@ To whitelist players for your Minecraft server, pass the Minecraft usernames sep
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible. If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
> NOTE: When `WHITELIST` is used the server property `white-list` will automatically get set to `true`.
> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup.
### Op/Administrator Players ### Op/Administrator Players
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
docker run -d -e OPS=user1,user2 ... docker run -d -e OPS=user1,user2 ...
> By default, the players in `OPS` are **added** to the final `ops.json` file by the Minecraft server. If you set `OVERRIDE_OPS` to "true" then the `ops.json` file will be recreated on each server startup.
### Server icon ### Server icon
A server icon can be configured using the `ICON` variable. The image will be automatically A server icon can be configured using the `ICON` variable. The image will be automatically
@@ -766,6 +788,10 @@ downloaded, scaled, and converted from any other image format:
docker run -d -e ICON=http://..../some/image.png ... docker run -d -e ICON=http://..../some/image.png ...
The server icon which has been set doesn't get overridden by default. It can be changed and overridden by setting `OVERRIDE_ICON` to `TRUE`.
docker run -d -e ICON=http://..../some/other/image.png -e OVERRIDE_ICON=TRUE...
### Rcon ### Rcon
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables. To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
+12
View File
@@ -0,0 +1,12 @@
version: "3"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
volumes:
# attach the relative directory 'data' to the container's /data path
./data:/data
+13 -6
View File
@@ -81,16 +81,23 @@ if [[ "$MODS" ]]; then
do do
if isURL $i; then if isURL $i; then
log "Downloading mod/plugin $i ..." log "Downloading mod/plugin $i ..."
effective_url=$(resolveEffectiveUrl "$i") if isValidFileURL jar "$i"; then
if isValidFileURL jar "${effective_url}"; then if ! curl -fsSL -o "${out_dir}/$(getFilenameFromUrl "${i}")" "${i}"; then
out_file=$(getFilenameFromUrl "${effective_url}")
if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then
log "ERROR: failed to download from $i into $out_dir" log "ERROR: failed to download from $i into $out_dir"
exit 2 exit 2
fi fi
else else
log "ERROR: $effective_url resolved from $i is not a valid jar URL" effective_url=$(resolveEffectiveUrl "$i")
exit 2 if isValidFileURL jar "${effective_url}"; then
out_file=$(getFilenameFromUrl "${effective_url}")
if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then
log "ERROR: failed to download from $i into $out_dir"
exit 2
fi
else
log "ERROR: $effective_url resolved from $i is not a valid jar URL"
exit 2
fi
fi fi
else else
log "ERROR Invalid URL given in MODS: $i" log "ERROR Invalid URL given in MODS: $i"
+27 -15
View File
@@ -3,28 +3,40 @@
. ${SCRIPTS:-/}start-utils . ${SCRIPTS:-/}start-utils
if [ -n "$OPS" ]; then if [ -n "$OPS" ]; then
log "Setting/adding ops" log "Updating ops"
rm -rf /data/ops.txt.converted rm -f /data/ops.txt.converted
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ops.json file at server startup"
rm -f /data/ops.json
fi
fi fi
if [ -n "$WHITELIST" ]; then if [ -n "$WHITELIST" ]; then
log "Setting whitelist" log "Updating whitelist"
rm -rf /data/white-list.txt.converted rm -f /data/white-list.txt.converted
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
if isTrue "${OVERRIDE_WHITELIST}"; then
log "Recreating whitelist.json file at server startup"
rm -f /data/whitelist.json
fi
fi fi
if [ -n "$ICON" -a ! -e server-icon.png ]; then if [ -n "$ICON" ]; then
log "Using server icon from $ICON..." if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
# Not sure what it is yet...call it "img" log "Using server icon from $ICON..."
curl -sSL -o /tmp/icon.img $ICON # Not sure what it is yet...call it "img"
specs=$(identify /tmp/icon.img | awk '{print $2,$3}') curl -sSL -o /tmp/icon.img $ICON
if [ "$specs" = "PNG 64x64" ]; then specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
mv /tmp/icon.img /data/server-icon.png if [ "$specs" = "PNG 64x64" ]; then
else mv /tmp/icon.img /data/server-icon.png
log "Converting image to 64x64 PNG..." else
convert /tmp/icon.img -resize 64x64! /data/server-icon.png log "Converting image to 64x64 PNG..."
fi convert /tmp/icon.img -resize 64x64! /data/server-icon.png
fi
fi
fi fi
if ! isTrue ${SKIP_LOG4J_CONFIG}; then if ! isTrue ${SKIP_LOG4J_CONFIG}; then
+2 -1
View File
@@ -145,7 +145,8 @@ requireVar() {
} }
function writeEula() { function writeEula() {
if ! echo "# Generated via Docker on $(date) if ! echo "# Generated via Docker
# $(date)
eula=${EULA,,} eula=${EULA,,}
" >/data/eula.txt; then " >/data/eula.txt; then
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}" log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"