diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index 0d14641f..39c26537 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -22,7 +22,7 @@ COPY --from=buildstage /media/data ./media COPY --from=buildstage /library ./library COPY --from=buildstage /websoft9/appmanage_new ./apphub -RUN apt update && apt install git jq supervisor -y && \ +RUN apt update && apt install git jq iproute2 supervisor -y && \ mkdir credentials && \ echo "This folder stored the credentials of other services that integrated with apphub" > credentials/readme diff --git a/docker/apphub/config/entrypoint.sh b/docker/apphub/config/entrypoint.sh index e94d57e3..cd6f5f5e 100644 --- a/docker/apphub/config/entrypoint.sh +++ b/docker/apphub/config/entrypoint.sh @@ -39,6 +39,10 @@ git config --global user.name "$username" git config --global user.email "$password" set -e +internal_ip=$(ip addr show eth0 | awk '/inet /{split($2, a, "/"); print a[1]}') +nsenter -m -u -i -n -p -t 1 sh -c "sed -i '/websoft9-apphub/d' /etc/hosts" +nsenter -m -u -i -n -p -t 1 sh -c "echo $internal_ip websoft9-apphub>> /etc/hosts" + # start by supervisord /usr/bin/supervisord supervisorctl start all