Skip to content

Commit

Permalink
Add data volume to dockerfiles (microsoft#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Tal Zaccai <[email protected]>
  • Loading branch information
akoken and TalZaccai authored Jul 30, 2024
1 parent fb51144 commit cb74c6b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
WORKDIR /app
COPY --from=build /app .

RUN mkdir /data \
&& chown -R $APP_UID:$APP_UID /data

VOLUME /data

# Run container as a non-root user
USER $APP_UID

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS runtime
WORKDIR /app
COPY --from=build /app .

RUN mkdir /data \
&& chown -R $APP_UID:$APP_UID /data

VOLUME /data

# Run container as a non-root user
USER $APP_UID

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.cbl-mariner
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-cbl-mariner2.0 AS runtime
WORKDIR /app
COPY --from=build /app .

RUN mkdir /data \
&& chown -R $APP_UID:$APP_UID /data

VOLUME /data

# Run container as a non-root user
USER $APP_UID

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.chiseled
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled AS runtime
WORKDIR /app
COPY --from=build /app .

VOLUME /data

# For inter-container communication.
EXPOSE 6379

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS runtime
WORKDIR /app
COPY --from=build /app .

RUN mkdir /data \
&& chown -R $APP_UID:$APP_UID /data

VOLUME /data

# Run container as a non-root user
USER $APP_UID

Expand Down

0 comments on commit cb74c6b

Please sign in to comment.