Skip to content

Commit 686fc33

Browse files
authored
Match UID for hasura in Dockerfile and connector-definition Dockerfile (#65)
* Match UID for hasura in Dockerfile and connector-definition Dockerfile
1 parent dec0339 commit 686fc33

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ RUN echo ${CONNECTOR_VERSION} > /scripts/CONNECTOR_VERSION
2424
COPY /functions /functions
2525
RUN /scripts/package-restore.sh
2626

27-
# Create non-root user, let useradd pick a unique UID
28-
RUN useradd -m -s /bin/bash hasura \
27+
# Explicitly set UID/GID to match the cache mount used in ./connector-definition/Dockerfile
28+
RUN groupadd -g 1001 hasura \
29+
&& useradd -m -s /bin/bash -u 1001 -g hasura hasura \
2930
&& chown -R hasura:hasura /scripts /functions
3031

3132
USER hasura

connector-definition/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ghcr.io/hasura/ndc-nodejs-lambda:v{{VERSION}}
33
COPY --chown=hasura:hasura package-lock.json package.json /functions/
44

55
WORKDIR /functions
6-
RUN --mount=type=cache,target=/home/hasura/.npm,uid=1000,gid=1000 \
6+
RUN --mount=type=cache,target=/home/hasura/.npm,uid=1001,gid=1001 \
77
npm ci
88

99
COPY --chown=hasura:hasura ./ /functions

0 commit comments

Comments
 (0)