- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Windows 上运行 docker build 时遇到问题,
Dockerfile:
FROM node:alpine AS builder
WORKDIR /app
COPY . .
RUN npm cache clean --force
RUN npm install > npm.log 2>&1
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist/* /usr/share/nginx/html
命令:
docker build --no-cache --rm -t fe-app:latest .
问题:
Step 8/8 : COPY --from=builder /app/dist/* /usr/share/nginx/html
COPY failed: opengcs: copyWithTimeout: timed out (RunProcess: copy back from remotefs lstat /tmp/666137919f5d3c5661175c59a8f4f9051ed09611a5b560e7045828ec1f9c1ec7-mount/app/dist/uncommon/assets/data-test/service-staff-data/services-staff-ui-action.json)
完整控制台输出:
Sending build context to Docker daemon 4.471MB
Step 1/8 : FROM node:alpine AS builder
alpine: Pulling from library/node
bdf0201b3a05: Pull complete
26f0dbb4f100: Pull complete
9af56c7c17da: Pull complete
Digest: sha256:ca1695f514d5dc54b4812f8b9029b277f86b50e83870af47bfa4582af0ec695d
Status: Downloaded newer image for node:alpine
---> 1bdfa12c22dc
Step 2/8 : WORKDIR /app
---> Running in 75a2de3672da
Removing intermediate container 75a2de3672da
---> 53a7b85e7278
Step 3/8 : COPY . .
---> a6fbf046933b
Step 4/8 : RUN npm cache clean --force
---> Running in 16148fc51784
npm WARN using --force I sure hope you know what you are doing.
Removing intermediate container 16148fc51784
---> 1f0b1dbf0a36
Step 5/8 : RUN npm install > npm.log 2>&1
---> Running in 8ac705a53089
Removing intermediate container 8ac705a53089
---> 6ae70108adb1
Step 6/8 : RUN npm run build
---> Running in ba84c78a50bb
> uncommon@0.0.0 build /app
> ng build
Date: 2019-04-18T13:22:02.537Z
Hash: 3d032830d7fde6941cf7
Time: 66267ms
chunk {main} main.js, main.js.map (main) 270 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 237 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 23.9 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.14 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 7.69 MB [initial] [rendered]
Removing intermediate container ba84c78a50bb
---> 487cf0c02a50
Step 7/8 : FROM nginx:alpine
alpine: Pulling from library/nginx
bdf0201b3a05: Already exists
08d74e155349: Pull complete
a9e2a0b35060: Pull complete
d9e2304ab8d0: Pull complete
Digest: sha256:61e3db30b1334b1fa0a2e71b86625188f76653565d515d5f74ecc55a8fb91ce9
Status: Downloaded newer image for nginx:alpine
---> 0be75340bd9b
Step 8/8 : COPY --from=builder /app/dist/* /usr/share/nginx/html
COPY failed: opengcs: copyWithTimeout: timed out (RunProcess: copy back from remotefs lstat /tmp/666137919f5d3c5661175c59a8f4f9051ed09611a5b560e7045828ec1f9c1ec7-mount/app/dist/uncommon/assets/data-test/service-staff-data/services-staff-ui-action.json)
我在本地环境上运行相同的内容并成功运行,但我在服务器上遇到问题,当我在服务器上运行它时,它会在我的本地环境上生成文件夹 c:\tmp\666137919f5d3c5661175c59a8f4f9051ed09611a5b560e7045828ec1f9c1ec7-mount t。
希望有人给我提示,先谢谢了。
最佳答案
这不是如何解决问题的解决方案,而是如何避免问题的解决方案:
首先压缩文件夹,然后仅复制 zip 文件。
Dockerfile:
FROM node:alpine AS builder
RUN apk add zip
WORKDIR /app
COPY . .
RUN npm cache clean --force
RUN npm install > npm.log 2>&1
RUN npm run build
RUN zip -r npm.zip /app/dist
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN apk add unzip
COPY --from=builder /app/npm.zip /usr/share/nginx/html/
RUN unzip npm.zip
关于Windows 上的 Dockerfile 复制超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55747845/
我正在尝试使用谷歌云构建触发器来构建我的 docker 容器。不幸的是,构建没有找到我的 docker 文件。它不在我的存储库的根目录中,但我认为我可以指定一个相对路径。显然我配置错误了。下面是我的
我可以像这样构建一个 Dockerfile docker build -t deepak/ruby . 但是对于一个不名为Dockerfile的Dockerfile # DOCKER-VERSION
是否可以命名构建阶段?我正在搜索类似以下示例的内容: ARG NAME FROM python:3.7-alpine as modul-${NAME} # ... 如果我尝试这个例子,就会发生这个错误
在我的 Dockerfile 中,我需要使用命令替换来添加一些环境变量。我想设置 ENV PYTHONPATH /usr/local/$(python3 -c 'from distutils impo
以下Dockerfile包含四个COPY层: COPY README.md ./ COPY package.json ./ COPY gulpfile.js ./ COPY __BUILD_NUMBE
我正在尝试从我创建的 Dockerfile 中拉取 tomcat,并使用以下命令拉取 centos: FROM centos RUN docker run -it tomcat 然后现在我正在创建一个
我不确定是否应该为我的 Node.js 应用程序创建不同的 Dockerfile 文件。一种用于没有开发依赖项的生产,另一种用于包含开发依赖项的测试。 或者一个基本上是开发Dockerfile.dev
我拥有的是多个相似且简单的dockerfile 但我想要的是有一个单一的基础 dockerfile 和我的 dockerfile将他们的变量传递给它。 在我的例子中,dockerfile 之间的唯一区
我有一个应用程序有两个 Dockerfile ,说 Dockerfile.foo和 Dockerfile.bar ,预计将为 docker-compose.yml 的两个不同服务生成两个不同的图像.
我是一个 docker maven 插件新手。 如果我理解得很好,根据Spotify's Dockerfile Maven documentation ,应该将 Dockerfile 放在我的项目的根
我正在设置一个docker容器,将在this article之后在nginx服务器上为我的Angular 5应用程序提供服务。 本文提出了这个Dockerfile: # Stage 0, based
大家好, 我是 docker 的新手,我想容器化我的 ASP.NET Core 应用程序,但出现错误,我无法继续构建我的图像 这是我的示例 Dockerfile FROM microsoft/dotn
我想在不使用注册表的情况下链接 Dockerfiles,这可以通过 FROM 实现吗?陈述? 以两个 Dockerfile 为例: Dockerfile /some/other/dir/Dockerf
我尝试在公共(public) dockerhub 上通过我自己的镜像安装 Airflow,但它在本地运行完美,但当我尝试在 Openshift 上使用它时。我在下面收到此错误。 `ERROR: Cou
此 dockerfile 工作正常。但是如何在 dockerfile 中执行命令? FROM alpine RUN apk add --update sqlite && rm -rf /var/cac
当我尝试设置自动构建时,我的 Docker Hub 存储库中的 Dockerfile 为空。如果我触发构建:- Build failed: Dockerfile not found at ./Dock
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 1年前关闭。 Improve this
我目前正在将一个巨大的 DockerFile 拆分为单独的 DockerFile,但是在巨大的 DockerFile 中定义的一些变量需要在单独的 DockerFile 中使用。 Docker 是否有
我有一个 Dockerfile 可以创建我想在这里使用的构建镜像:~/build/Dockerfile 然后我使用一个标准镜像来部署 从 ~/build/Dockerfile 构建的图像没有在任何地方
我运行这个: ➜ frontend git:(master) ✗ docker-compose up Building web ERROR: Cannot locate specified Dock
我是一名优秀的程序员,十分优秀!