Skip to content

Commit 7f8fcb5

Browse files
committed
refactor: simplify Dockerfile by integrating ownership change into the COPY instruction.
1 parent 1aea686 commit 7f8fcb5

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

docker/Dockerfile.sql_to_arc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,12 @@ FROM alpine:3.23.3
6565

6666
WORKDIR /middleware
6767

68-
# Copy the entire directory created by --onedir
69-
COPY --from=binary-builder /build/dist/sql_to_arc /middleware/sql_to_arc
70-
71-
# Create non-root user and group and fix permissions
68+
# Create non-root user and group
7269
RUN addgroup -S sql_to_arc && \
73-
adduser -S sql_to_arc -G sql_to_arc && \
74-
chown -R sql_to_arc:sql_to_arc /middleware
70+
adduser -S sql_to_arc -G sql_to_arc
71+
72+
# Copy the entire directory created by --onedir with correct ownership
73+
COPY --chown=sql_to_arc:sql_to_arc --from=binary-builder /build/dist/sql_to_arc /middleware/sql_to_arc
7574

7675
USER sql_to_arc
7776

0 commit comments

Comments
 (0)