From 2a3919869287f832685cfb21c1cf1cbd81a10318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 24 Jul 2022 11:41:46 +0200 Subject: [PATCH] ws Dockerfile: use here-doc for entrypoint creation, use exec --- docker/aquatic_ws.Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/aquatic_ws.Dockerfile b/docker/aquatic_ws.Dockerfile index bbe15f8..3d508fc 100644 --- a/docker/aquatic_ws.Dockerfile +++ b/docker/aquatic_ws.Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + # aquatic_ws # # WORK IN PROGRESS @@ -39,7 +41,15 @@ WORKDIR /root/ COPY --from=builder /usr/src/aquatic/target/release/aquatic_ws ./ -# Enable 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_ws -P -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_ws -P -c ./config.toml +EOT + +RUN chmod +x ./entrypoint.sh ENTRYPOINT ["./entrypoint.sh"]