mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
udp Dockerfile: use here-doc for entrypoint creation
This commit is contained in:
parent
2a39198692
commit
bd70474d73
1 changed files with 15 additions and 2 deletions
|
|
@ -1,8 +1,13 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
# aquatic_udp
|
||||
#
|
||||
# Customize by setting CONFIG_FILE_CONTENTS and
|
||||
# ACCESS_LIST_CONTENTS environment variables.
|
||||
#
|
||||
# By default runs tracker on port 3000 without info hash access control.
|
||||
#
|
||||
# Run from repository root directory with:
|
||||
# $ docker build -t aquatic-udp -f docker/aquatic_udp.Dockerfile .
|
||||
# $ docker run -it -p 0.0.0.0:3000:3000/udp --name aquatic-udp aquatic-udp
|
||||
|
||||
|
|
@ -23,7 +28,15 @@ WORKDIR /root/
|
|||
|
||||
COPY --from=builder /usr/src/aquatic/target/release/aquatic_udp ./
|
||||
|
||||
# Setting config and access list file contents at runtime
|
||||
RUN echo "#!/bin/sh\necho \"\$CONFIG_FILE_CONTENTS\" > ./config.toml\necho \"\$ACCESS_LIST_CONTENTS\" > ./access-list.txt\n./aquatic_udp -c ./config.toml" > entrypoint.sh && chmod +x entrypoint.sh
|
||||
# Create entry point script for setting config and access
|
||||
# list file contents at runtime
|
||||
COPY <<-"EOT" ./entrypoint.sh
|
||||
#!/bin/sh
|
||||
echo "$CONFIG_FILE_CONTENTS" > ./config.toml
|
||||
echo "$ACCESS_LIST_CONTENTS" > ./access-list.txt
|
||||
exec ./aquatic_udp -P -c ./config.toml
|
||||
EOT
|
||||
|
||||
RUN chmod +x ./entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue