【发布时间】:2019-07-27 05:48:34
【问题描述】:
对于下面的 dockerfile:
FROM buildpack-deps:buster
RUN groupadd -r someteam --gid=1280 && useradd -r -g someteam --uid=1280 --create-home --shell /bin/bash someteam
# Update and allow for apt over HTTPS
RUN apt-get update && \
apt-get install -y apt-utils
RUN apt-get install -y apt-transport-https
RUN apt update -y
RUN apt install python3-pip -y
# switch user from 'root' to ‘someteam’ and also to the home directory that it owns
USER someteam
RUN pwd
USER只更改用户而不更改主目录
编辑:
Step 11/14 : WORKDIR $HOME
cannot normalize nothing
如何将主目录更改为/home/someteam?
【问题讨论】:
-
“主目录”在 Docker 中通常不是一个概念。在
/app中安装您的应用程序很常见,即使那不是“正常”的 Linux 目录。
标签: docker dockerfile