Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails at gradlew assemble #145

Open
DahnJ opened this issue Mar 11, 2020 · 3 comments
Open

Docker build fails at gradlew assemble #145

DahnJ opened this issue Mar 11, 2020 · 3 comments

Comments

@DahnJ
Copy link

DahnJ commented Mar 11, 2020

When building the docker image according to the instructions, I get the error

Downloading http://services.gradle.org/distributions/gradle-1.4-bin.zip

Unzipping /root/.gradle/wrapper/dists/gradle-1.4-bin/47n6g3pbi5plc7n8fn58nkinje/gradle-1.4-bin.zip to /root/.gradle/wrapper/dists/gradle-1.4-bin/47n6g3pbi5plc7n8fn58nkinje
Exception in thread "main" java.util.zip.ZipException: zip file is empty
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:221)
	at java.util.zip.ZipFile.<init>(ZipFile.java:151)
	at java.util.zip.ZipFile.<init>(ZipFile.java:165)
	at org.gradle.wrapper.Install.unzip(Install.java:148)
	at org.gradle.wrapper.Install.createDist(Install.java:65)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
The command '/bin/sh -c cd /opt/ && git clone https://github.com/openstreetmap/osmosis.git && cd osmosis && git checkout tags/0.43.1 && ./gradlew assemble && echo "export PATH=${PATH}:/opt/osmosis/package/bin" >
> /root/.bashrc' returned a non-zero code: 1

This happens at the layer

RUN cd /opt/ && git clone https://github.com/openstreetmap/osmosis.git && cd osmosis && git checkout tags/0.43.1 && ./gradlew assemble && echo "export PATH=${PATH}:/opt/osmosis/package/bin" >> /root/.bashrc

I'm using the latest commit (1faaea46f171415d745f3cbaf26d3df725d5b580)))

@pabloito
Copy link

The Issue seems to be the link is missing an https://

http://services.gradle.org/distributions/gradle-1.4-bin.zip Does not Work
https://services.gradle.org/distributions/gradle-1.4-bin.zip Does work.

It would be nice if they patched this.

[Temporary Fix]
Change line 21 of /map/Dockerfile
From && git checkout tags/0.43.1
to && git checkout f4dd495e3af03d0a2048e6a541dc052a77102c18

This forces the build to use an updated version of osmosis with an https:// url for gradle distribution.

@BrentonPoke
Copy link

The Issue seems to be the link is missing an https://

http://services.gradle.org/distributions/gradle-1.4-bin.zip Does not Work https://services.gradle.org/distributions/gradle-1.4-bin.zip Does work.

It would be nice if they patched this.

[Temporary Fix] Change line 21 of /map/Dockerfile From && git checkout tags/0.43.1 to && git checkout f4dd495e3af03d0a2048e6a541dc052a77102c18

This forces the build to use an updated version of osmosis with an https:// url for gradle distribution.

This still hasn't been fixed, because I just ran into it.

@OSrange
Copy link

OSrange commented Oct 12, 2022

The Issue seems to be the link is missing an https://
http://services.gradle.org/distributions/gradle-1.4-bin.zip Does not Work https://services.gradle.org/distributions/gradle-1.4-bin.zip Does work.
It would be nice if they patched this.
[Temporary Fix] Change line 21 of /map/Dockerfile From && git checkout tags/0.43.1 to && git checkout f4dd495e3af03d0a2048e6a541dc052a77102c18
This forces the build to use an updated version of osmosis with an https:// url for gradle distribution.

This still hasn't been fixed, because I just ran into it.

I replaced the Run command with the following(using openjdk-8-jdk and osmosis 0.47.4).Then it works.

RUN apt-get -y install software-properties-common && apt-get update && add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get -y install patch postgresql-9.3-postgis-2.1 git openjdk-8-jdk python-psycopg2 python-numpy python-gdal
RUN patch /etc/postgresql/9.3/main/postgresql.conf < /opt/pgsql/postgresql.conf.patch && patch /etc/postgresql/9.3/main/pg_hba.conf < /opt/pgsql/pg_hba.conf.patch && echo "export HOME=/root" >> /root/.bashrc
RUN cd /opt/ && git clone https://github.com/openstreetmap/osmosis.git && cd osmosis && git checkout 0.47.4 && ./gradlew assemble && echo "export PATH=${PATH}:/opt/osmosis/package/bin" >> /root/.bashrc
CMD service postgresql start && /bin/bash --rcfile /root/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants