Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. MZFROM ubuntu-base
  10. RUN apt-get update && TZ=UTC DEBIAN_FRONTEND=noninteractive apt-get install -qy maven xmlstarlet && apt-get clean && rm -rf /var/lib/apt/lists/*
  11. COPY pom.xml /scratch/
  12. # Convince Maven to download all necessary plugins to a local repository, so
  13. # that they get baked into the image. The `dependency:go-offline` plugin is a
  14. # bit buggy, so we have to make sure to actually execute a test to get the
  15. # maven-surefire plugin installed.
  16. RUN xmlstarlet ed --inplace \
  17. --subnode /_:settings --type elem --name localRepository --value /var/lib/maven/repository \
  18. /usr/share/maven/conf/settings.xml \
  19. && (cd /scratch \
  20. && echo "public class NoopTest { @org.junit.jupiter.api.Test void testNoop() {} }" > NoopTest.java \
  21. && mvn -Dtest=NoopTest dependency:go-offline package) \
  22. && xmlstarlet ed --inplace \
  23. --subnode /_:settings --type elem --name offline --value true \
  24. /usr/share/maven/conf/settings.xml