Skip to content

Commit

Permalink
Add a fix to always dirty on Windows docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
simar0at committed Oct 29, 2024
1 parent b7e3dd0 commit 70f31c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ WORKDIR /app/
COPY . /app

# Create the user and install all dependencies
# Declare the /app directory as a safe for any git operations, like reading the revision and tag
# Reset the git repository to the last commit as otherwise
# the image will report as dirty if build on windows due to the line endings.
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt update && apt -y full-upgrade && apt install -y git && pip3 install poetry && apt clean \
&& poetry config virtualenvs.create false && poetry install --no-dev && poetry cache clear --all . \
&& git config --system --add safe.directory /app
&& git config --system --add safe.directory /app \
&& cd /app && git reset --hard

USER app

Expand Down

0 comments on commit 70f31c0

Please sign in to comment.