emcniece / DockerYourXyzzy

Dockerized Cards Against Humanity clone - https://github.com/ajanata/PretendYoureXyzzy
71 stars 38 forks source link

unable to run with overrides #6

Open xSkyer opened 4 years ago

xSkyer commented 4 years ago

I am trying to override pyx.admin_addrs in order to get admin privileges. Here's the command I am trying to use:

docker run -d \ -p 8080:8080 \ --name pyx-dev \ emcniece/dockeryourxyzzy:dev \ mvn clean package war:war \ -Dhttps.protocols=TLSv1.2 \ -Dmaven.buildNumber.doCheck=false \ -Dmaven.buildNumber.doUpdate=false \ -Dmaven.hibernate.url=jdbc:postgresql://postgres/pyx \ -Dmaven.pyx.admin_addrs=127.0.0.1,MYIPHERE,0:0:0:0:0:0:0:1

Docker logs result:

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:10 h [INFO] Finished at: 2020-04-06T11:36:37Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project pyx: Could not resolve dependencies for project net.socialgamer:pyx:jar:0.7.0-SNAPSHOT: Failed to collect dependencies at com.maxmind.geoip2:geoip2:jar:2.8.0 -> com.maxmind.db:maxmind-d b:jar:1.2.1 -> com.fasterxml.jackson.core:jackson-databind:jar:2.9.2-SNAPSHOT -> com.fasterxml.jackson.core:jackson-core:jar:2.9.2-SNAPSHOT: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-core:jar:2.9 .2-SNAPSHOT: Could not transfer artifact com.fasterxml.jackson.core:jackson-core:pom:2.9.2-SNAPSHOT from/to sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots): Failed to transfer file: https://os s.sonatype.org/content/repositories/snapshots/com/fasterxml/jackson/core/jackson-core/2.9.2-SNAPSHOT/jackson-core-2.9.2-SNAPSHOT.pom. Return code is: 502 , ReasonPhrase:Bad Gateway. -> [Help 1]

eagle1maledetto commented 4 years ago

Hi,

even just cloning the repo and give a docker-compose up --build, it fails with similar error.

I've done the same IDENTICAL step, 1 week ago and worked with no fuss. Now I can't just get the whole thing to build.

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 42.299 s [INFO] Finished at: 2020-04-13T17:04:32Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project pyx: Could not resolve dependencies for project net.socialgamer:pyx:jar:0.7.0-SNAPSHOT: Failed to collect dependencies at com.maxmind.geoip2:geoip2:jar:2.8.0 -> com.maxmind.db:maxmind-db:jar:1.2.1 -> com.fasterxml.jackson.core:jackson-databind:jar:2.9.0,pr4-SNAPSHOT: Failed to read artifact descriptor for com.fasterxml. jackson.core:jackson-databind:jar:2.9.0,pr4-SNAPSHOT: Could not find artifact com.fasterxml.jackson:jackson-bom:pom:2.9.0.pr4-SNAPSHOT in hibernatesqlite-maven (https://hibernate-sqlite.googlecode.com/svn/trunk/mavenrepo) -> [Help 1] [ERROR]

eagle1maledetto commented 4 years ago

I don't know why the compose fail so bad. But if you just run it with docker and use the dev tagged image you can use docker parameters to have some overrides, and it works with no problem. The compose yml is utterly broken I think.

eagle1maledetto commented 4 years ago

Here @xSkyer

https://hub.docker.com/r/emcniece/dockeryourxyzzy

docker run -d \ -p 8080:8080 \ emcniece/dockeryourxyzzy:dev \ mvn clean package war:war \ -Dhttps.protocols=TLSv1.2 \ -Dmaven.buildNumber.doCheck=false \ -Dmaven.buildNumber.doUpdate=false \ -Dmaven.hibernate.url=jdbc:postgresql://postgres/pyx

emcniece commented 4 years ago

The Dockerfiles themselves don't perform well - looking back on this project 2 years later, it's clear that the build stages and tags need to be refactored. I'd also guess that the compose file doesn't have all of the needed flags.

It's possible (likely, even) that the upstream project has changed and I haven't been been watching it at all, so maybe this build repo is missing some requirements. The issues here are stacking up, it's on my list, alas I am but a single developer 😄

Thank you for your help!

emcniece commented 4 years ago

I have just pushed some updates to master and hopefully this resolves the compose file problems. Check out the README and try the "Run with Docker-Compose" section, and make sure your docker-compose.yml file specifies emcniece/dockeryourxyzzy:3 or that you run docker pull emcniece/dockeryourxyzzy:latest.

GieltjE commented 4 years ago

Think I have found a problem: Simply running "docker-compose up -d --build" will get you the latest version but not all build.properties are overriden with the custom file. The first file that isn't overridden does appear to work when I edit it manually and restart it.

/var/lib/docker/btrfs/subvolumes/15e01c785d41002c0cc666c29068344c47cbca79e0d97df2761352b524d1230f/overrides/build.properties
not overridden --> /var/lib/docker/btrfs/subvolumes/15e01c785d41002c0cc666c29068344c47cbca79e0d97df2761352b524d1230f/project/build.properties
/var/lib/docker/btrfs/subvolumes/15e01c785d41002c0cc666c29068344c47cbca79e0d97df2761352b524d1230f-init/overrides/build.properties
not overridden --> /var/lib/docker/btrfs/subvolumes/15e01c785d41002c0cc666c29068344c47cbca79e0d97df2761352b524d1230f-init/project/build.properties
/var/lib/docker/btrfs/subvolumes/6ad4cb8b3cc389ec98d87bc51a20d04640e6700183906987605192a273cefbd4/overrides/build.properties
/var/lib/docker/btrfs/subvolumes/7f222ed0f48a5bb20af22e96a9b1b0a2001a66ca246a47818728b1bb9f6d8c48/overrides/build.properties
/var/lib/docker/btrfs/subvolumes/ff5338e28b0bdca07db7e23a7e020672b5f75e5b47bb74d05c6dde95e79c7ab2/overrides/build.properties
not overridden --> /var/lib/docker/btrfs/subvolumes/ff5338e28b0bdca07db7e23a7e020672b5f75e5b47bb74d05c6dde95e79c7ab2/project/build.properties
emcniece commented 4 years ago

Hm... so maybe this is a layer/cache issue, the properties file is being referenced from unexpected layers?

I wonder if https://github.com/emcniece/DockerYourXyzzy/issues/7#issuecomment-676851196 and the idea of ENV overrides would solve this by dynamically generating build.properties at runtime...