使用:docker build -t myapp, 无法成功获取图像

Use: docker build -t myapp . cannot get image successfully

我的Docker文件是:

1
2
3
4
5
6
FROM microsoft/aspnet
COPY . /app
WORKDIR /app
RUN ["dnu","restore"]
EXPOSE 5004
ENTRYPOINT ["dnx","project.json","kestrel"]

我的Docker档案有什么问题吗?

以下是答复:

1
2
3
4
5
6
7
Restore failed
A task was canceled.
NuGet Config files used:
    /root/.config/NuGet/NuGet.Config
Feeds used:
    https://www.nuget.org/api/v2/
The command 'dnu restore' returned a non-zero code: 1


Docker文件需要更新如下,然后确定生成:

1
2
3
4
5
6
7
FROM microsoft/aspnet:1.0.0-beta4
ADD . /app
WORKDIR /app
RUN ["dnu","restore"]

EXPOSE 5004
ENTRYPOINT ["dnx","./src/HelloMvc6","kestrel"]