繁体   English   中英

通过apt-get安装cron在docker ubuntu:12.04容器中因权限问题而失败

[英]Installing cron via apt-get fails in a docker ubuntu:12.04 container from permissions problems

我正在尝试通过我的Dockerfile中的apt-get install安装cron(以及其他软件包)。 我已将Dockerfile简化为最低限度:

FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y cron

我在安装过程中看到的错误是:

Step 4 : RUN apt-get install -y cron
 ---> Running in 991339f4be58
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  anacron logrotate checksecurity exim4 postfix mail-transport-agent
The following NEW packages will be installed:
  cron
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 85.0 kB of archives.
After this operation, 308 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main cron amd64 3.0pl1-120ubuntu4 [85.0 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 85.0 kB in 0s (204 kB/s)
Selecting previously unselected package cron.
(Reading database ... 7551 files and directories currently installed.)
Unpacking cron (from .../cron_3.0pl1-120ubuntu4_amd64.deb) ...
Setting up cron (3.0pl1-120ubuntu4) ...
Adding group `crontab' (GID 102) ...
groupadd: failure while writing changes to /etc/group
addgroup: `/usr/sbin/groupadd -g 102 crontab' returned error code 10. Exiting.
dpkg: error processing cron (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cron
E: Sub-process /usr/bin/dpkg returned an error code (1)
2014/07/03 10:09:13 The command [/bin/sh -c apt-get install -y cron] returned a non-zero code: 100

在docker容器内手动运行$ groupadd / etc / group会导致相同的错误“groupadd:将更改写入/ etc / group时失败”。

其他软件包如wget和curl都安装得很好。 是否存在docker需要运行才能执行groupadds的进程? 或者Dockerfile中是否有一个步骤需要首先发生,我错过了?

提前致谢。

我不得不在运行docker的fedora机器上禁用SELinux。 执行setenforce 0,编辑/ etc / selinux / conf以禁用并重启我的机器修复它。 我没有意识到我的docker容器会从运行它的机器继承权限问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM