Skip to content

Commit 3b0e0e6

Browse files
politiciancopybara-github
authored andcommitted
GitHub PR#186 Fix Docker build to match Google Cloud Build script
-- 72ad3db by Romain Barissat <[email protected]>: Add buildozer and buildifier to Docker image -- 1b457cc by Romain Barissat <[email protected]>: Fix Docker build to match Google Cloud Build script Signed-off-by: Romain Barissat <[email protected]> Closes #186 GitOrigin-RevId: e257c64 Change-Id: Id003a1ce1b2d4d1149247c8834e4fb757ccefe21
1 parent e15786a commit 3b0e0e6

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

Dockerfile

+9-21
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM l.gcr.io/google/bazel:latest AS build
16-
17-
WORKDIR /usr/src/copybara
18-
15+
FROM gcr.io/cloud-builders/bazel:latest AS build
1916
COPY . .
20-
21-
RUN bazel build //java/com/google/copybara:copybara_deploy.jar \
22-
&& mkdir -p /tmp/copybara \
23-
&& cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/
24-
25-
# Fails currently
26-
# RUN bazel test //...
17+
RUN ./cloudbuild.sh build //java/com/google/copybara:copybara_deploy.jar
18+
RUN mkdir -p /tmp/copybara && \
19+
cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/
2720

2821
FROM golang:latest AS buildtools
29-
3022
RUN go get github.com/bazelbuild/buildtools/buildozer
3123
RUN go get github.com/bazelbuild/buildtools/buildifier
3224

33-
FROM openjdk:8-jre-slim
25+
FROM openjdk:11-jre-slim
26+
WORKDIR /usr/src/app
3427
ENV COPYBARA_CONFIG=copy.bara.sky \
3528
COPYBARA_SUBCOMMAND=migrate \
3629
COPYBARA_OPTIONS='' \
@@ -39,12 +32,7 @@ ENV COPYBARA_CONFIG=copy.bara.sky \
3932
COPY --from=build /tmp/copybara/ /opt/copybara/
4033
COPY --from=buildtools /go/bin/buildozer /go/bin/buildifier /usr/bin/
4134
COPY .docker/entrypoint.sh /usr/local/bin/copybara
42-
4335
RUN chmod +x /usr/local/bin/copybara
44-
45-
# Install git for fun times
46-
RUN apt-get update \
47-
&& apt-get install -y git \
48-
&& apt-get clean
49-
50-
WORKDIR /usr/src/app
36+
RUN apt-get update && \
37+
apt-get install -y git && \
38+
apt-get clean

0 commit comments

Comments
 (0)