diff --git a/Dockerfile b/Dockerfile index 6432e55..facd28d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,9 @@ RUN echo ${CONNECTOR_VERSION} > /scripts/CONNECTOR_VERSION COPY /functions /functions RUN /scripts/package-restore.sh -# Create non-root user, let useradd pick a unique UID -RUN useradd -m -s /bin/bash hasura \ +# Explicitly set UID/GID to match the cache mount used in ./connector-definition/Dockerfile +RUN groupadd -g 1001 hasura \ + && useradd -m -s /bin/bash -u 1001 -g hasura hasura \ && chown -R hasura:hasura /scripts /functions USER hasura diff --git a/connector-definition/Dockerfile b/connector-definition/Dockerfile index 4501b93..af72fb3 100644 --- a/connector-definition/Dockerfile +++ b/connector-definition/Dockerfile @@ -3,7 +3,7 @@ FROM ghcr.io/hasura/ndc-nodejs-lambda:v{{VERSION}} COPY --chown=hasura:hasura package-lock.json package.json /functions/ WORKDIR /functions -RUN --mount=type=cache,target=/home/hasura/.npm,uid=1000,gid=1000 \ +RUN --mount=type=cache,target=/home/hasura/.npm,uid=1001,gid=1001 \ npm ci COPY --chown=hasura:hasura ./ /functions