minikube中的建筑物图像卡住了

时间:2019-08-30 09:19:08

标签: docker kubernetes

我正在尝试在minikube中部署本地映像。 这就是我正在做的:

  1. minikube开始
  2. 评估$(minikube docker-env)
  3. 尝试在minikube中构建图像(build image -t my-image。),但它停留在2. fetching packages...

我没有设置任何HTTP_PROXY,HTTPS_PROXY,NO_PROXY。有人遇到这样的问题吗?

编辑。这是我的Dockerfile。工作正常。我可以从远程Docker注册表中构建,推送和拉取。仅当我在minikube中构建图像时,它才行不通。

FROM node:10.16.2-alpine

WORKDIR /app/server

ADD package.json .

RUN apk --no-cache add --virtual .build build-base python && \
  yarn install && \
  npm rebuild bcrypt --build-from-source && \
  yarn cache clean && \
  apk del .build

ADD . .

EXPOSE 3000

CMD [ "yarn", "start" ]

这是minikube中的docker build日志:

Sending build context to Docker daemon    292MB
Step 1/7 : FROM node:10.16.2-alpine
 ---> 4f877c96a193
Step 2/7 : WORKDIR /app/server
 ---> Using cache
 ---> 71cd2676c364
Step 3/7 : ADD package.json .
 ---> Using cache
 ---> af5f79d46abf
Step 4/7 : RUN apk --no-cache add --virtual .build build-base python &&   yarn install &&   npm rebuild bcrypt --build-from-source &&   yarn cache clean &&   apk del .build
 ---> Running in c38695ed65b7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/27) Installing binutils (2.31.1-r2)
(2/27) Installing libmagic (5.36-r0)
(3/27) Installing file (5.36-r0)
(4/27) Installing gmp (6.1.2-r1)
(5/27) Installing isl (0.18-r0)
(6/27) Installing libgomp (8.3.0-r0)
(7/27) Installing libatomic (8.3.0-r0)
(8/27) Installing mpfr3 (3.1.5-r1)
(9/27) Installing mpc1 (1.0.3-r1)
(10/27) Installing gcc (8.3.0-r0)
(11/27) Installing musl-dev (1.1.20-r5)
(12/27) Installing libc-dev (0.7.1-r0)
(13/27) Installing g++ (8.3.0-r0)
(14/27) Installing make (4.2.1-r2)
(15/27) Installing fortify-headers (1.0-r0)
(16/27) Installing build-base (0.5-r1)
(17/27) Installing libbz2 (1.0.6-r7)
(18/27) Installing expat (2.2.7-r0)
(19/27) Installing libffi (3.2.1-r6)
(20/27) Installing gdbm (1.13-r1)
(21/27) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(22/27) Installing ncurses-terminfo (6.1_p20190105-r0)
(23/27) Installing ncurses-libs (6.1_p20190105-r0)
(24/27) Installing readline (7.0.003-r1)
(25/27) Installing sqlite-libs (3.28.0-r0)
(26/27) Installing python2 (2.7.16-r1)
(27/27) Installing .build (0)
Executing busybox-1.29.3-r10.trigger
OK: 211 MiB in 43 packages
yarn install v1.17.3
info No lockfile found.
[1/4] Resolving packages...
warning bugsnag@2.4.3: All projects should upgrade to our universal JS notifier: "@bugsnag/js". See https://github.com/bugsnag/bugsnag-js/blob/master/UPGRADING.md for more details.
warning bugsnag > cuid > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
warning node-mailer@0.1.1: node-mailer is not maintained
warning jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning jest > jest-cli > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning nest-cli > exists-sync@0.0.3: Please replace with usage of fs.existsSync
warning supertest > superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...

1 个答案:

答案 0 :(得分:0)

您可以尝试增加--network timeout参数,在共享Dockerfile的yarn命令行中对其进行修改,如注释中提到的@Marc ABOUCHACRA:

yarn install --network-timeout 1000000

该问题似乎非常普遍,与minikube VM无关,只需在此堆栈thread中搜索详细信息即可。