我的文件存在于Docker镜像中的位置?

我将在Travis-CI版本中切换到基于容器的基础架构。 所以我在我的Dockerfile中写下了以下命令,镜像成功构build:

RUN apt-get install software-properties-common -y RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y RUN apt-get update RUN apt-get install gcc-4.9 -y RUN apt-get install build-essential perl python git -y RUN apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev -y RUN apt-get install libedit-dev -y RUN apt-get install flex bison gperf libicu-dev libxslt-dev -y RUN git clone git://code.qt.io/qt/qt5.git qt5 RUN cd qt5 && perl init-repository RUN unset QTDIR RUN export PATH="$PWD/qtbase/bin:$PWD/qtrepotools/bin:$PATH" RUN cd qt5 && ./configure -developer-build -opensource -confirm-license -nomake examples -nomake tests RUN cd qt5 && make RUN cd qt5 && make install RUN git clone git://code.qt.io/qt-creator/qt-creator.git qt-creator RUN mkdir qt-creator-build RUN cd qt-creator-build RUN ../qt5/qtbase/bin/qmake -r ../qt-creator/qtcreator.pro RUN make -j5 

在将其推送到Docker Hub之前,我需要知道我的东西在图像中创build的位置。 我需要像我的文件的地图从Travis-CI获取访问。 请帮我理解。 谢谢

UPD:实际上,我只需要一个qt-creator-build文件夹的绝对path。

基于你的命令, qt-creator-build文件夹的绝对path应该是/qt-creator-build ,因为根目录/每个 docker命令的默认工作目录。

也就是说,命令RUN make -j5可能应该是RUN cd qt-creator-build && make -j5 ,但是只有当你真的想 qt-creator-build运行make -j5 ,这就是我从代码中理解的。

从Docker的文档中,您可以使用WORKDIR命令来更改de工作目录,如:

 WORKDIR qt-creator-build