Skip to content

Commit

Permalink
remove explicit chown step that made docker image bigger (#1101)
Browse files Browse the repository at this point in the history
* remove explicit chown step that made docker image bigger

* remove chmod
  • Loading branch information
captncraig authored Jun 24, 2024
1 parent 5ce405e commit e000bbf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,15 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


COPY --from=build /src/alloy/build/alloy /bin/alloy
COPY example-config.alloy /etc/alloy/config.alloy
COPY --from=build --chown=$UID /src/alloy/build/alloy /bin/alloy
COPY --chown=$UID example-config.alloy /etc/alloy/config.alloy

# Create alloy user in container, but do not set it as default
#
# NOTE(rfratto): non-root support in Docker containers is an experimental,
# undocumented feature; use at your own risk.
RUN groupadd --gid $UID $USERNAME
RUN useradd -m -u $UID -g $UID $USERNAME
RUN chown -R $USERNAME:$USERNAME /etc/alloy
RUN chown -R $USERNAME:$USERNAME /bin/alloy

RUN mkdir -p /var/lib/alloy/data
RUN chown -R $USERNAME:$USERNAME /var/lib/alloy
Expand Down

0 comments on commit e000bbf

Please sign in to comment.