Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker 's Error: libselinux conflicts with fakesystemd

I'm building docker image with a Dockerfile:

FROM       centos:centos7.1.1503
MAINTAINER foo <[email protected]>

ENV TZ "Asia/Shanghai"
ENV TERM xterm

RUN \
    yum update -y && \
    yum install -y epel-release &&\
    yum update -y && \
    yum install -y curl wget tar bzip2 unzip vim-enhanced passwd sudo yum-utils hostname net-tools rsync man && \
    yum install -y gcc gcc-c++ git make automake cmake patch logrotate python-devel libpng-devel libjpeg-devel && \
    yum install -y pwgen python-pip && \
    yum clean all

and it show the error as below:

Error: libselinux conflicts with fakesystemd-1-17.el7.centos.noarch

If I change FROM centos:centos7.1.1503 to FROM centos:centos7,all will work fine. So ,what should I do to using centos7.1.1503

My Linux Distribution is Ubuntu 16.04.1 LTS and my docker version is 1.12.6.

like image 316
xiang Avatar asked Nov 20 '22 02:11

xiang


1 Answers

Try running this inside the container you create, before any installation is made:

yum swap -y fakesystemd systemd && yum clean all
yum update -y  && yum clean all

Or inside a Dockerfile at the begining before the first RUN you have tipped:

RUN yum swap -y fakesystemd systemd && yum clean all \
    && yum update -y  && yum clean all

Hope was useful!

like image 94
Juanma Avatar answered Nov 26 '22 20:11

Juanma