【发布时间】:2017-11-29 10:50:17
【问题描述】:
我有以下要构建的 Dockerfile。它基本上只是普通的 jboss/wildfly 基础镜像,但是使用 amazonlinux 而不是 centOS 构建的。
构建错误出现在“groupadd: Command not found”这一行
在我第一次添加“epel”存储库并尝试手动安装它之后,正如您在第一个 RUN 指令中看到的那样。我已经阅读了一些论坛,并且似乎有时您在不以 root 身份运行时会收到该错误消息。我做了一个“whoami”,我以 root 身份运行,所以这应该不是问题。
有人知道为什么我仍然收到错误消息吗?
FROM amazonlinux:2017.03
# Install packages necessary to run EAP
RUN yum-config-manager --enable epel && yum update -y && yum -y install groupadd xmlstarlet saxon augeas bsdtar unzip && yum clean all
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
chmod 755 /opt/jboss
# Set the working directory to jboss' user home directory
WORKDIR /opt/jboss
# Specify the user which should be used to execute all commands below
USER jboss
提前致谢!
【问题讨论】:
-
您可能已经找到了这个,但这并不是为了安装我所说的必需品。您必须构建您的 amazonlinux 容器以满足您的需求。您可能仍然缺少其他基本包forums.aws.amazon.com/thread.jspa?threadID=242790
标签: docker amazon-linux