简体   繁体   中英

run npm ci hangs on docker build ubuntu

I'm trying to build a docker file for an ionic project, on ubuntu virtualbox. Here's the dockerfile:

# Build
FROM beevelop/ionic AS ionic
# Create the application directory
WORKDIR /usr/src/app
# Install the application dependencies
# We can use wildcard to ensure both package.json AND package-lock.json are considered
# where available (npm@5+)
COPY package*.json ./
RUN npm --verbose ci
# Bundle app source
COPY . .
RUN ionic build

## Run 
FROM nginx:alpine
#COPY www /usr/share/nginx/html
COPY --from=ionic /usr/src/app/www /usr/share/nginx/html

My problem is that the build gets stuck on step 4 ( RUN npm --verbose ci ) It starts downloading some packages, but then it hangs at some point. I tried different solution:

npm clean cache
npm config set registry http://registry.npmjs.org/

removing package-lock.json

But nothing works, any help will be greatly apprecited. Thanks in advance

To whoever experienced this problem, it was to due to internet connection. Keep trying until it downloads all the packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM