kopia lustrzana https://github.com/mumble-voip/mumble-docker
Merge PR #19: Make Dockerfile compatible to latest upstream layout
With mumble-voip/mumble#5838 the file structure of the upstream repo has changed slightly and most importantly the location of the default server ini file has changed as well. Thus, we now have to check multiple locations inside our Dockerfile in order to make it work with the old and the new layout.pull/20/head
commit
141af419a6
|
@ -55,7 +55,11 @@ ARG MUMBLE_VERSION=latest
|
|||
ARG MUMBLE_BUILD_NUMBER=""
|
||||
ARG MUMBLE_CMAKE_ARGS=""
|
||||
|
||||
RUN /mumble/scripts/clone.sh && /mumble/scripts/build.sh
|
||||
# Clone the repo, build it and finally copy the default server ini file. Since this file may be at different locations and Docker
|
||||
# doesn't support conditional copies, we have to ensure that regardless of where the file is located in the repo, it will end
|
||||
# up at a unique path in our build container to be copied further down.
|
||||
RUN /mumble/scripts/clone.sh && /mumble/scripts/build.sh \
|
||||
&& /mumble/scripts/copy_one_of.sh ./scripts/murmur.ini ./auxiliary_files/mumble-server.ini default_config.ini
|
||||
|
||||
|
||||
|
||||
|
@ -66,7 +70,7 @@ ARG MUMBLE_GID=1000
|
|||
RUN groupadd --gid $MUMBLE_GID mumble && useradd --uid $MUMBLE_UID --gid $MUMBLE_GID mumble
|
||||
|
||||
COPY --from=build /mumble/repo/build/mumble-server /usr/bin/mumble-server
|
||||
COPY --from=build /mumble/repo/scripts/murmur.ini /etc/mumble/bare_config.ini
|
||||
COPY --from=build /mumble/repo/default_config.ini /etc/mumble/bare_config.ini
|
||||
|
||||
RUN mkdir -p /data && chown -R mumble:mumble /data && chown -R mumble:mumble /etc/mumble
|
||||
USER mumble
|
||||
|
|
|
@ -98,7 +98,7 @@ else
|
|||
|
||||
# Apply default settings if they're missing
|
||||
|
||||
set_config "database" "${DATA_DIR}/murmur.sqlite" true
|
||||
set_config "database" "${DATA_DIR}/mumble-server.sqlite" true
|
||||
set_config "ice" "\"tcp -h 127.0.0.1 -p 6502\"" true
|
||||
set_config "welcometext" "\"<br />Welcome to this server, running the official Mumble Docker image.<br />Enjoy your stay!<br />\"" true
|
||||
set_config "port" 64738 true
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script can be used to copy the first existing file to the
|
||||
# target destination.
|
||||
# Thus
|
||||
# copy_one_of.sh a b c
|
||||
# copies either a or b to c. The first of the target files that
|
||||
# exists will be copied. The rest will be ignored.
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ "$#" < 2 ]]; then
|
||||
>&2 echo "Too few arguments - expected at least two"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
parameters=( "$@" )
|
||||
target_file="${parameters[$(( $# - 1))]}"
|
||||
|
||||
found=false
|
||||
|
||||
# Make use of num. of arguments $# to iterate up to the i - 1st argument (last one is destination)
|
||||
for i in $(seq 0 $(( $# - 2 )) ); do
|
||||
current_file=${parameters[$i]}
|
||||
|
||||
if [[ -f "$current_file" ]]; then
|
||||
cp "$current_file" "$target_file"
|
||||
found=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$found" = "false" ]]; then
|
||||
>&2 echo "Did not find any of the source files - nothing was copied"
|
||||
exit 1
|
||||
fi
|
Ładowanie…
Reference in New Issue