Issue
I am now running a Docker container in my Linux machine. The dockerfile is as follows:
# 1. basic image
FROM tensorflow/tensorflow:1.12.0-devel-py3
ENV DEBIAN_FRONTEND=noninteractive LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_CTYPE="UTF-8"
# 2. apps
RUN apt update && apt install -y --no-install-recommends \
software-properties-common && \
add-apt-repository -y ppa:ubuntu-desktop/ubuntu-make && \
apt update \
&& apt install -y --no-install-recommends \
build-essential \
vim \
ubuntu-make \
&& umake ide pycharm /root/.local/share/umake/ide/pycharm
Everything goes on well, but when I enter the Docker container using the following command:
sudo docker run --ipc=host --gpus all --net=host -it -d --rm -h docker -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw
-v /usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu, -v /usr/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu
--privileged
Then I try command such as apt update
, I will receive the following messages:
apt: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.27' not found (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
However, this will not happen if the command is invoked in the Docker image file Dockerfile
. For example, at the end of the Dockerfile
, if I invoke
RUN apt update && apt install -y firefox
, no errors appear.
I cannot understand why only in the Docker container is GLIBC_2.27
link problem identified.
Solution
I got the answer thanks to the help of @KamilCuk.
The reason why I got this error is because my host machine is Ubuntu 18.04 and my guest machine (Container) is Ubuntu 16.04.
This is no problem, but when I enter the Container, I share the two folders between host machine and guest machine:
/usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
As a result, the guest system tries to use libraries in the host machine, which is wrong. I forgot the reason why I decide to share host machine's libraries with the guest machine. Anyway, if I disable it, everything goes on well.
Answered By - feelfree Answer Checked By - Senaida (WPSolving Volunteer)