-
-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containers are running as root #53
Comments
@vcan92 Thank you for your report! I'll take a look... |
Hi @vcan92! You probably added the |
@djablonski-moia Thank you for your help on this issue!! You are correct! I'll push a new release soon to correct the wording. |
I'm not sure I understand. Do you mean that containers could be running as root with the following
|
@vcan92 @johanfleury @djablonski-moia Think there was indeed an issue with the pod security sanitizer. Think is fixed in 0.6.1! @johanfleury I think @djablonski-moia is talking about setting the security context at the container level vs the pod. If you set it at the pod level then all containers will inherit their contexts from the pod and the kubelet with start the container(s) in that context. |
Describe the bug
I get a warning even though the containers dont run as root user.
My Dockerfile
FROM microsoft/dotnet:2.1-sdk
WORKDIR /build_dir
COPY . .
RUN dotnet restore /build_dir/src/Banners/Banners.csproj
RUN dotnet restore /build_dir/tests/Banners.IntegrationTests/Banners.IntegrationTests.csproj
RUN dotnet restore /build_dir/tests/Banners.UnitTests/Banners.UnitTests.csproj
RUN dotnet build /build_dir/src/Banners/Banners.csproj
RUN dotnet test /build_dir/tests/Banners.UnitTests/Banners.UnitTests.csproj
RUN dotnet publish /build_dir/src/Banners/Banners.csproj -o /publish
WORKDIR /publish
RUN groupadd -r storefront && useradd -r -g storefront storefront
RUN chown -R storefront:storefront /build_dir
USER storefront
ENTRYPOINT ["dotnet", "Banners.dll"]
Deployment.yaml
And I added this block on my deployment.yaml
securityContext:
runAsUser: 999
runAsGroup: 999
runAsNonRoot: true
allowPrivilegeEscalation: false
Versions:
What am I doing wrong? Thanks for your help.
The text was updated successfully, but these errors were encountered: