Skip to content

Commit

Permalink
chore(blackduck): add permission to nonroot user
Browse files Browse the repository at this point in the history
SUITEDEV-35556
  • Loading branch information
matusekma committed Apr 30, 2024
1 parent d9cc19e commit fbf61cc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Dockerfile.codescan
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
FROM debian:12.5

ARG FLUTTER_SDK=/usr/local/flutter
ARG FLUTTER_SDK=/workspace/source/flutter
ARG FLUTTER_VERSION=3.16.9

COPY . /workspace/source
WORKDIR /workspace/source

# install all needed stuff
RUN apt-get update
RUN apt-get install -y curl git unzip

RUN groupadd -r nonroot && useradd -r -s /bin/false -g nonroot nonroot
RUN chown -R nonroot:nonroot /workspace/source
RUN chown -R nonroot:nonroot /usr/local
USER nonroot
RUN chown -R nonroot:nonroot /home

#clone flutter
RUN git clone https://github.com/flutter/flutter.git $FLUTTER_SDK
Expand All @@ -25,10 +22,15 @@ RUN cd $FLUTTER_SDK && git fetch && git checkout $FLUTTER_VERSION
ENV PATH="$FLUTTER_SDK/bin:$FLUTTER_SDK/bin/cache/dart-sdk/bin:${PATH}"

RUN cd /workspace/source

COPY . /workspace/source
RUN flutter doctor

RUN chown -R nonroot:nonroot .dart_tool
RUN chown -R nonroot:nonroot /workspace/source
# RUN chown -R nonroot:nonroot /workspace/source/flutter

USER nonroot
# remove unnecessary files
CMD flutter pub get && cat pubspec.lock && rm -rf example
CMD rm -rf example && flutter pub get


0 comments on commit fbf61cc

Please sign in to comment.