简体   繁体   中英

Docker build hangs during downloads

Mac 10.10.5 here, using docker-machine to create a VirtualBox host VM for my local Docker. I have a project that builds an executable JVM located at build/libs/myapp-SNAPSHOT.jar . My Dockerfile , which is located in the root of the project, looks like:

FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
ADD build/libs/myapp-SNAPSHOT.jar myapp.jar
RUN sh -c 'touch /myapp.jar'
ENTRYPOINT ["java","-jar","/myapp.jar"]

Please note, I don't wish to push my images to any registry, just keep/run them locally (for now). When I run:

docker build -t myorg/myapp .

I get the following console output:

myuser@mymachine:~/sandbox/myapp$docker build -t myorg/myapp .
Sending build context to Docker daemon 42.69 MB
Step 1 : FROM frolvlad/alpine-oraclejdk8:slim
slim: Pulling from frolvlad/alpine-oraclejdk8

d0ca440e8637: Downloading [=================================================> ] 2.295 MB/2.32 MB
0f86278f6be1: Downloading [=================================================> ] 3.149 MB/3.172 MB
c704a6161dca: Download complete 

And then the command-line just hangs after printing that " Download complete " message. I've waited for as long as 30 minutes (!!!) and nothing happens.

Any ideas where I'm going awry?

The VM is probably hanging. Try the following: https://github.com/docker/machine/issues/1819#issuecomment-138981139

docker-machine rm -f default
rm -fv ~/.docker/machine
docker-machine -D create -d virtualbox default

There are more issues about this on OSX.

I think the best practice is to setup a Linux native build box if you are doing any serious development. That way you can run docker without any VM overhead(which is ironically one of the major pain points docker is trying to solve)

There's also a Docker Beta program which runs on libcontainer natively on OSX and Windows.

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