Commit 6f95eac2 authored by Tulir Asokan's avatar Tulir Asokan 🐈
Browse files

Update things in Docker image

parent e313c2e0
Pipeline #5858 passed with stage
in 1 minute and 33 seconds
FROM golang:1.18 as signaldctl
WORKDIR /src
RUN git clone https://gitlab.com/signald/signald-go.git . \
&& make signaldctl
FROM gradle:7-jdk${JAVA_VERSION:-17} AS build
COPY . /tmp/src
WORKDIR /tmp/src
ARG CI_BUILD_REF_NAME
ARG CI_COMMIT_SHA
RUN VERSION=$(./version.sh) gradle -Dorg.gradle.daemon=false build
RUN tar xf build/distributions/signald.tar -C /opt
FROM eclipse-temurin:17-jre AS release
USER root
RUN apt-get update && apt-get install -y gosu && apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=build /opt/signald /opt/signald/
COPY --from=signaldctl /src/signaldctl /opt/signaldctl
RUN ln -sf /opt/signald/bin/signald /usr/local/bin/ \
&& ln -sf /opt/signaldctl /usr/local/bin/ \
&& mkdir -p /root/.config/ \
&& echo "socketpath: /signald/signald.sock" > /root/.config/signaldctl.yaml
VOLUME /signald
ADD docker-entrypoint.sh /entrypoint.sh
ENV UID=1337 GID=1337
ENTRYPOINT ["/entrypoint.sh"]
CMD ["-d", "/signald", "-s", "/signald/signald.sock", "-v", "--trust-new-keys"]
......@@ -14,4 +14,7 @@ if [[ "${SIGNALD_DATABASE:-}" == "postgres"* ]] && [[ -f "/signald/signald.db" ]
signaldctl db-move "${SIGNALD_DATABASE}" /signald/signald.db || (echo "database move failed, leaving container running for 10 minutes" && sleep 600 && exit 1)
fi
signald "$@"
if [[ "$(id -u)" == "0" ]]; then
chown -R $UID:$GID /signald
fi
exec gosu $UID:$GID signald "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment