[英]Where are the packages installed with `apt-get install` in Docker containers?
I'm trying to locate the libgsl.so
library in a Docker container after installing it successfully . 成功安装后,我正在尝试在Docker容器中找到libgsl.so
库。
When I run an interactive shell with docker run -it container/image bash
and try to find it find / -iname "*libgsl*"
I get nothing (the tool tries to find it under /usr/lib/). 当我使用docker run -it container/image bash
运行交互式shell并尝试找到它时, find / -iname "*libgsl*"
我什么也没得到(该工具尝试在/ usr / lib /下找到它)。 It seems that the same is true for another successfully installed libraries (eg libjpeg62). 对于另一个成功安装的库(例如libjpeg62),似乎也是如此。
So, generally, where are these libraries being installed ? 因此,通常, 这些库在哪里安装 ?
I'm running Docker with VBox in MacOS. 我在MacOS中使用VBox运行Docker。 Here is the Dockerfile
file: 这是Dockerfile
文件:
FROM phusion/baseimage
# Install dependencies
RUN apt-get update && apt-get install -y \
libgsl0ldbl \
curl \
gsl-bin
# Installs preseq from sources into /opt/
ENV PRESEQ_RELEASE=2.0
ENV PRESEQ_URL=http://smithlabresearch.org/downloads/preseq_linux_v${PRESEQ_RELEASE}.tar.bz2
ENV DEST_DIR=/opt/
# Download preseq; untar & decompress; remove tr.bz2 file; compile & install preseq; remove unnecessary files
RUN curl -SLo ${DEST_DIR}/preseq_v${PRESEQ_RELEASE}.tar.bz2 ${PRESEQ_URL} && \
tar -xf ${DEST_DIR}/preseq_v${PRESEQ_RELEASE}.tar.bz2 -C ${DEST_DIR} && \
rm -f ${DEST_DIR}/preseq_v${PRESEQ_RELEASE}.tar.bz2
ENV PATH=${DEST_DIR}/preseq_v${PRESEQ_RELEASE}:$PATH
CMD ["preseq"]
UPDATE UPDATE
I was running the wrong container (not using the right tag) where I didn't have the library installed. 我在安装了库的地方运行了错误的容器(未使用正确的标签)。 After changing the tag, I found the libraries without a problem. 更改标签后,我发现库没有问题。 Packages are installed in the default locations (in this case /usr/lib/). 软件包安装在默认位置(在本例中为/ usr / lib /)。
Since phusion/baseimage
use Ubuntu 由于phusion/baseimage
使用Ubuntu
Ask the package management what files the package contains: 向软件包管理询问软件包包含的文件:
dpkg -L libgsl0ldbl
This shows the files simply copied to those locations. 这显示了仅复制到这些位置的文件。 These files are marked as managed by the package management 这些文件被标记为由包管理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.