From 843dcc0e4a6f6a596bb893fdd4f6d977b4ddcd08 Mon Sep 17 00:00:00 2001 From: John Niang Date: Wed, 14 Dec 2022 23:12:22 +0800 Subject: [PATCH] Support command-line arguments running with Docker (#2942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /area core #### What this PR does / why we need it: Now, we can pass command-line arguments while using Docker. Please refer to . #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2902 #### Special notes for your reviewer: Steps to test: 1. Run Halo with command-line arguments: ```bash docker run --rm -it -p6666:6666 johnniang/halo:support-command-line-args --server.port=6666 ``` 1. Request ```bash curl -v http://localhost:6666 ``` #### Does this PR introduce a user-facing change? ```release-note 支持命令行参数启动 Halo ``` --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ffb72be30..80cfb9b5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,4 @@ ENV JVM_OPTS="-Xmx256m -Xms256m" \ RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone -ENTRYPOINT java ${JVM_OPTS} -Djava.security.egd=file:/dev/./urandom org.springframework.boot.loader.JarLauncher \ No newline at end of file +ENTRYPOINT ["sh", "-c", "java ${JVM_OPTS} org.springframework.boot.loader.JarLauncher ${0} ${@}"]