Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132
  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. ARG ARCH_GCC
  11. RUN apt-get update \
  12. && TZ=UTC DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  13. ca-certificates \
  14. curl \
  15. git \
  16. libxml2-dev \
  17. && apt-get clean \
  18. && rm -rf /var/lib/apt/lists/*
  19. # Bazelisk is a Bazel runner that reads the version from our .bazelversion file.
  20. ENV BAZELISK_VERSION="1.25.0"
  21. # Download the binary from the official GitHub releases since the apt repositories do not contain
  22. # arm64 releases.
  23. RUN arch_bazel=$(echo "$ARCH_GCC" | sed "s/aarch64/arm64/" | sed "s/x86_64/amd64/" ) \
  24. && curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-linux-$arch_bazel \
  25. && if [[ "$arch_bazel" = arm64 ]]; then echo '4c8d966e40ac2c4efcc7f1a5a5cceef2c0a2f16b957e791fa7a867cce31e8fcb /usr/local/bin/bazel' | sha256sum --check; fi \
  26. && if [[ "$arch_bazel" = amd64 ]]; then echo 'fd8fdff418a1758887520fa42da7e6ae39aefc788cf5e7f7bb8db6934d279fc4 /usr/local/bin/bazel' | sha256sum --check; fi \
  27. && chmod +x /usr/local/bin/bazel