Merge pull request #12885 from id/0416-docker-chown-workdir

fix: qlc could not create temp files in docker container (#12875)
This commit is contained in:
Ivan Dyachkov 2024-04-16 09:33:27 +02:00 committed by GitHub
commit 9b65c12075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

2
build
View File

@ -493,7 +493,7 @@ make_docker() {
if [ "${DOCKER_PUSH:-false}" = true ]; then
DOCKER_BUILDX_ARGS+=(--push)
fi
if [ "${DOCKER_LOAD:-false}" = true ]; then
if [ "${DOCKER_LOAD:-true}" = true ]; then
DOCKER_BUILDX_ARGS+=(--load)
fi
if [ -d "${REBAR_GIT_CACHE_DIR:-}" ]; then

View File

@ -47,18 +47,19 @@ ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
COPY deploy/docker/docker-entrypoint.sh /usr/bin/
COPY --from=builder /emqx-rel /opt/
RUN set -eu; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates procps $(echo "${EXTRA_DEPS}" | tr ',' ' '); \
rm -rf /var/lib/apt/lists/*; \
find /opt/emqx -name 'swagger*.js.map' -exec rm {} +; \
ln -s /opt/emqx/bin/* /usr/local/bin/; \
groupadd -r -g 1000 emqx; \
useradd -r -m -u 1000 -g emqx emqx; \
mkdir -p /opt/emqx/log /opt/emqx/data /opt/emqx/plugins; \
chown -R emqx:emqx /opt/emqx/log /opt/emqx/data /opt/emqx/plugins
useradd -r -m -u 1000 -g emqx emqx;
COPY --from=builder --chown=emqx:emqx /emqx-rel /opt/
RUN set -eu; \
find /opt/emqx -name 'swagger*.js.map' -exec rm {} +; \
ln -s /opt/emqx/bin/* /usr/local/bin/;
WORKDIR /opt/emqx