Docker 带窗口的Sagemaker

Docker 带窗口的Sagemaker,docker,amazon-sagemaker,Docker,Amazon Sagemaker,我正在尝试使用Docker将aws sagemaker与Windows一起使用: 这是docker文件: # Build an image that can do training and inference in SageMaker # This is a Python 2 image that uses the nginx, gunicorn, flask stack # for serving inferences in a stable way. FROM ubuntu:16.04

我正在尝试使用Docker将aws sagemaker与Windows一起使用: 这是docker文件:

# Build an image that can do training and inference in SageMaker
# This is a Python 2 image that uses the nginx, gunicorn, flask stack
# for serving inferences in a stable way.

FROM ubuntu:16.04

MAINTAINER Amazon AI <sage-learner@amazon.com>


RUN apt-get -y update && apt-get install -y --no-install-recommends \
         wget \
         python3.5 \
         nginx \
         libgcc-5-dev \
         ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Here we get all python packages.
# There's substantial overlap between scipy and numpy that we eliminate by
# linking them together. Likewise, pip leaves the install caches populated which uses
# a significant amount of space. These optimizations save a fair amount of space in the
# image, which reduces start up time.
RUN wget https://bootstrap.pypa.io/3.3/get-pip.py && python3.5 get-pip.py && \
    pip3 install numpy==1.14.3 scipy scikit-learn==0.19.1 xgboost==0.72.1 pandas==0.22.0 flask gevent gunicorn && \
        (cd /usr/local/lib/python3.5/dist-packages/scipy/.libs; rm *; ln ../../numpy/.libs/* .) && \
        rm -rf /root/.cache

# Set some environment variables. PYTHONUNBUFFERED keeps Python from buffering our standard
# output stream, which means that logs can be delivered to the user quickly. PYTHONDONTWRITEBYTECODE
# keeps Python from writing the .pyc files which are unnecessary in this case. We also update
# PATH so that the train and serve programs are found when the container is invoked.

ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PATH="/opt/program:${PATH}"

# Set up the program in the image
COPY xgboost /opt/program
WORKDIR /opt/program
#构建一个可以在SageMaker中进行训练和推理的图像
#这是一个使用nginx、gunicorn和flask堆栈的Python 2映像
#以稳定的方式提供推论。
来自ubuntu:16.04
维护者亚马逊人工智能
运行apt-get-y更新和apt-get-install-y--不建议安装\
wget\
蟒蛇3.5\
nginx\
libgcc-5-dev\
ca证书\
&&rm-rf/var/lib/apt/lists/*
#这里我们得到了所有python包。
#scipy和numpy之间存在大量重叠,我们通过
#将它们连接在一起。同样,pip会让使用
#大量的空间。这些优化在系统中节省了相当多的空间
#图像,从而缩短启动时间。
运行wgethttps://bootstrap.pypa.io/3.3/get-pip.py &&python3.5 get-pip.py&&\
pip3安装numpy==1.14.3 scipy scikit学习==0.19.1 xgboost==0.72.1熊猫==0.22.0\
(cd/usr/local/lib/python3.5/dist-packages/scipy/.libs;rm*;ln.././numpy/.libs/*)&&\
rm-rf/root/.cache
#设置一些环境变量。PYTHONUNBUFFERED使Python无法缓冲我们的标准
#输出流,这意味着可以将日志快速交付给用户。PYTHONDONTWRITEBYTECODE
#防止Python编写在本例中不必要的.pyc文件。我们还更新了
#路径,以便在调用容器时找到train和serve程序。
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PATH=“/opt/program:${PATH}”
#在图像中设置程序
复制xgboost/opt/program
WORKDIR/opt/program
我的问题是,既然我在Windows7下工作,我是否应该更改以下路径:


谢谢你

你说的是环境路径吗

这将在docker容器中设置路径env,docker容器使用linux文件系统(ubuntu:16.04),因此您不必更改任何内容

编辑:


我重读了你的问题。docker文件中的任何路径都不必更改,因为它们是为docker容器本身配置的。

您是在谈论环境路径吗

这将在docker容器中设置路径env,docker容器使用linux文件系统(ubuntu:16.04),因此您不必更改任何内容

编辑:


我重读了你的问题。docker文件中的任何路径都不必更改,因为它们是为docker容器本身配置的。

感谢您的回答,因为我在本教程中看到Windows用户,而您是运行过时的docker工具箱的不幸者之一,确保使用C:\Users目录中的某个目录作为项目主文件夹。否则,您将遇到将文件夹装入容器的非常糟糕的体验。啊,明白了,我为您的混淆道歉。但是我相信Dockerfile在没有Windows文件系统上下文(C:)的情况下仍然可以很好地构建,因为Dockerfile的构建与您从Dockerfile构建映像的时间有关。如果您正在复制的文件夹(在这种情况下是“xgboost”)与Docker文件位于同一目录中,并且您在同一目录中构建Docker文件,我认为应该可以工作。感谢您的回复,因为我在本教程中看到Windows用户,而您是运行过时的Docker工具箱的不幸者之一,确保使用C:\Users目录中的某个目录作为项目主文件夹。否则,您将遇到将文件夹装入容器的非常糟糕的体验。啊,明白了,我为您的混淆道歉。但是我相信Dockerfile在没有Windows文件系统上下文(C:)的情况下仍然可以很好地构建,因为Dockerfile的构建与您从Dockerfile构建映像的时间有关。如果您正在复制的文件夹(在这种情况下为“xgboost”)与Dockerfile位于同一目录中,并且您在同一目录中构建Dockerfile,我相信它应该可以工作。