moorkop / mccy-engine

Provides a web based "Minecraft Server as a Service" (MCaaS?) to deploy Minecraft server containers on any Docker Swarm cluster or standalone Engine instance.
Apache License 2.0
12 stars 4 forks source link

Fails to build via docker? #30

Closed sshipway closed 8 years ago

sshipway commented 8 years ago

Trying to build the container via the Dockerfile. 6G available in /var and 12G in the build dir, no space runs out during the build. However the build fails on the ApplyLayer right at the end...

docker build --tag=sshipway/mccy .

... (very info, so download, much time ) ...

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:07 min
[INFO] Finished at: 2016-01-06T01:17:56+00:00
[INFO] Final Memory: 39M/273M
[INFO] ------------------------------------------------------------------------
ApplyLayer exit status 1 stdout:  stderr: mkdir /root/.m2/repository/org/springframework/boot/spring-boot-starter-data-elasticsearch: invalid argument

or, next attempt gives:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:08 min
[INFO] Finished at: 2016-01-06T01:28:00+00:00
[INFO] Final Memory: 40M/204M
[INFO] ------------------------------------------------------------------------
ApplyLayer exit status 1 stdout:  stderr: open /root/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.1.RELEASE/_remote.repositories: invalid argument

Is there an obvious reason why this would be?

Also, it would make sense for the build to assume an empty certs/ if one does not exist rather than crashing out, but that's a minor thing.

itzg commented 8 years ago

That is very strange. Yeah, I would have suspected running out of /var space, but you checked that already.

The easiest solution would be to commit an empty certs/ and then adjust .gitignore to ignore the contents of that.

sshipway commented 8 years ago

I don't suppose you could push a working container into your dockerhub repo? I want to run some tests on it here but seem to be unable to build.

itzg commented 8 years ago

Ah yes, I'll push one with an empty certs and that should be what you'll need.

Until I can do that, you give a plain old maven build a try. In that directory use the mvnw commands listed in the README.

sshipway commented 8 years ago

Strangely, it will build running ./mvnw package from the commandline; only when done via the Dockerfile does it fail like this. Docker build seems to be trying to copy things from /root/.m2 into the new intermediate image after running the build command, and failing. This is docker 1.7.1 which might be an issue? I'm wondering if the docker daemon may be running out of resource somehow when building?

Anyway, I've managed to make it build by changing like this:

RUN cd /build && ./mvnw -B package && cp /build/target/mccy-swarm-*.jar /usr/local/bin/mccy-swarm.jar && rm -rf /build $HOME/.m2

IE, put the rm in the same RUN and the build, reducing the changes at that step. Seems to result in a working build... now have to test.

itzg commented 8 years ago

@sshipway , give this image a try. You could do the usual --volumes-from to manage the /certs from a data container if you need cert authentication.

itzg commented 8 years ago

Can you go ahead and push that Dockerfile change that worked for you? I usually like combining steps like that into one image layer anyway.

sshipway commented 8 years ago

Fixed by pull req #32