Dockfile 使用 非root 用户运行容器

#Pull the base image as Ubuntu
FROM ubuntu:latest

#Add a user with userid 8877 and name nonroot
RUN useradd −u 8877 nonroot

#Run Container as nonroot
USER nonroot

ref: https://www.tutorialspoint.com/running-docker-container-as-a-non-root-user

posted @ 2021-04-04 10:35  佰大于  阅读(93)  评论(0编辑  收藏  举报