@@ -16,34 +16,35 @@ ARG BAZEL_VERSION=:7.1.0
16
16
17
17
# Set up buildtools required
18
18
FROM golang:latest AS buildtools
19
- RUN go install github.com/bazelbuild/buildtools/buildozer@latest
20
- RUN go install github.com/bazelbuild/buildtools/buildifier@latest
21
-
19
+ RUN go install github.com/bazelbuild/buildtools/buildozer@latest github.com/bazelbuild/buildtools/buildifier@latest
22
20
23
21
# Set up bazel env
24
22
FROM gcr.io/bazel-public/bazel${BAZEL_VERSION} AS build
25
- WORKDIR .
26
- USER root
27
23
28
- COPY --chown=ubuntu:root . .
29
- RUN apt-get update --fix-missing
30
- RUN apt-get install -y openjdk-17-jdk openjdk-17-jre git locales mercurial lsb-release software-properties-common quilt
31
- RUN add-apt-repository ppa:git-core/ppa -y
32
- RUN apt-get install -y git
33
- RUN apt-get update
24
+ USER root
25
+ RUN apt-get update && \
26
+ apt-get install --no-install-recommends -y openjdk-17-jdk-headless && \
27
+ rm -rf /var/lib/apt/lists/*
34
28
35
- # cleanup apt cache afterwards to keep image size small
36
- RUN rm -rf /var/lib/apt/lists/*
37
29
# Bazel does not allow running as root
38
30
USER ubuntu
31
+
32
+ WORKDIR /home/ubuntu/
33
+ COPY . .
34
+
39
35
RUN bazel build //java/com/google/copybara:copybara_deploy.jar --java_language_version=11 --tool_java_language_version=11 --java_runtime_version=remotejdk_11
40
- USER root
41
- RUN mkdir -p /opt/copybara && cp /home/ubuntu/bazel-bin/java/com/google/copybara/copybara_deploy.jar /opt/copybara/copybara_deploy.jar -r
42
- COPY --from=buildtools /go/bin/buildozer /go/bin/buildifier /usr/bin/
43
- USER ubuntu
44
36
37
+ # Use jammy to drop Python 2
38
+ FROM docker.io/eclipse-temurin:17-jre-jammy
39
+
40
+ RUN apt-get update && \
41
+ apt-get install --no-install-recommends -y git mercurial quilt && \
42
+ rm -rf /var/lib/apt/lists/*
43
+
44
+ COPY --from=buildtools /go/bin/buildozer /go/bin/buildifier /usr/local/bin/
45
+ COPY --from=build /home/ubuntu/bazel-bin/java/com/google/copybara/copybara_deploy.jar /opt/copybara/copybara_deploy.jar
45
46
COPY .docker/copybara /usr/local/bin/copybara
47
+
46
48
ENTRYPOINT ["/usr/local/bin/copybara" ]
47
49
CMD ["migrate" , "copy.bara.sky" ]
48
50
WORKDIR /usr/src/app
49
-
0 commit comments