Skip to content

Commit

Permalink
Add optional eclipselink dependency to build and include as build arg…
Browse files Browse the repository at this point in the history
… in Dockerfile (apache#114)

* Add optional eclipselink dependency to build and include as build arg in Dockerfile

* Update Dockerfile and build to use start script to support arguments from compose

* Format. Again

* Change shadowJar script to exclude version for easy reference from dockerfile

---------

Co-authored-by: Michael Collado <[email protected]>
  • Loading branch information
collado-mike and sfc-gh-mcollado authored Aug 20, 2024
1 parent f5c7dca commit 52b7a27
Show file tree
Hide file tree
Showing 5 changed files with 1,799 additions and 1,795 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Use a non-docker-io registry, because pulling images from docker.io is
# subject to aggressive request rate limiting and bandwidth shaping.
FROM registry.access.redhat.com/ubi9/openjdk-21:1.20-2.1721752936 as build
ARG ECLIPSELINK=false

# Copy the REST catalog into the container
COPY --chown=default:root . /app
Expand All @@ -26,14 +27,16 @@ WORKDIR /app
RUN rm -rf build

# Build the rest catalog
RUN ./gradlew --no-daemon --info clean shadowJar
RUN ./gradlew --no-daemon --info -PeclipseLink=$ECLIPSELINK clean shadowJar startScripts

FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.20-2.1721752928
WORKDIR /app
COPY --from=build /app/polaris-service/build/libs/polaris-service-1.0.0-all.jar /app
COPY --from=build /app/polaris-service/build/libs/polaris-service-all.jar /app/lib/polaris-service-all.jar
COPY --from=build /app/polaris-server.yml /app
COPY --from=build /app/polaris-service/build/scripts/polaris-service /app/bin/polaris-service

EXPOSE 8181

# Run the resulting java binary
CMD ["java", "-jar", "/app/polaris-service-1.0.0-all.jar", "server", "polaris-server.yml"]
ENTRYPOINT ["/app/bin/polaris-service"]
CMD ["server", "polaris-server.yml"]
10 changes: 2 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ services:
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_CLIENT_ID: $AZURE_CLIENT_ID
AZURE_CLIENT_SECRET: $AZURE_CLIENT_SECRET
command: # override the command to specify aws keys as dropwizard config
- java
- -Ddw.awsAccessKey=$AWS_ACCESS_KEY_ID
- -Ddw.awsSecretKey=$AWS_SECRET_ACCESS_KEY
- -jar
- /app/polaris-service-1.0.0-all.jar
- server
- polaris-server.yml
# add aws keys as dropwizard config
JAVA_OPTS: -Ddw.awsAccessKey=$AWS_ACCESS_KEY_ID -Ddw.awsSecretKey=$AWS_SECRET_ACCESS_KEY
volumes:
- credentials:/tmp/credentials/

Expand Down
4 changes: 2 additions & 2 deletions docs/configuring-polaris-for-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ Before using Polaris when using a metastore manager other than `in-memory`, you
To bootstrap Polaris, run:

```bash
java -jar /path/to/jar/polaris-service-1.0.0-all.jar bootstrap polaris-server.yml
java -jar /path/to/jar/polaris-service-all.jar bootstrap polaris-server.yml
```

Afterwards, Polaris can be launched normally:

```bash
java -jar /path/to/jar/polaris-service-1.0.0-all.jar server polaris-server.yml
java -jar /path/to/jar/polaris-service-all.jar server polaris-server.yml
```

## Other Configurations
Expand Down
Loading

0 comments on commit 52b7a27

Please sign in to comment.