Bug 1662305 - Remove workaround for shortcomings from kaniko < 1. r=taskgraph-reviewers,aki
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 01 Sep 2020 00:35:22 +0000
changeset 547152 2dde2efbc18dcc245afb25de2732d5b28394bcbb
parent 547151 1a0b21debe92db3bf4db1d04c41da9b3aa8625f1
child 547153 ad6c81e11152d987f87037d1329f31de16530d77
push id37745
push userbtara@mozilla.com
push dateTue, 01 Sep 2020 09:45:42 +0000
treeherdermozilla-central@ea855bdc21ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstaskgraph-reviewers, aki
bugs1662305
milestone82.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1662305 - Remove workaround for shortcomings from kaniko < 1. r=taskgraph-reviewers,aki Older versions of kaniko didn't handle $PATH correctly in `RUN` commands, and we worked around this by using full paths for the executables. Now that the base image builder is upgraded to kaniko 1, we can remove those workarounds. Differential Revision: https://phabricator.services.mozilla.com/D88932
taskcluster/docker/image_builder/Dockerfile
--- a/taskcluster/docker/image_builder/Dockerfile
+++ b/taskcluster/docker/image_builder/Dockerfile
@@ -1,31 +1,31 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FROM golang:1.14 as skopeo
 
 WORKDIR /go/src/
-RUN ["/usr/bin/git", "clone", "--no-checkout", "--depth=1", "--branch=v1.1.1", "https://github.com/containers/skopeo", "."]
-RUN ["/usr/bin/git", "checkout", "67abbb3cefbdc876447583d5ea45e76bf441eba7"]
+RUN ["git", "clone", "--no-checkout", "--depth=1", "--branch=v1.1.1", "https://github.com/containers/skopeo", "."]
+RUN ["git", "checkout", "67abbb3cefbdc876447583d5ea45e76bf441eba7"]
 ENV GO111MODULE=on CGO_ENABLED=0
-RUN ["/usr/local/go/bin/go", "build", \
+RUN ["go", "build", \
 	"-mod=vendor", "-o", "out/skopeo", \
 	"-tags", "exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp", \
 	# Set unixTempDirForBigFiles so skopeo will extract in a directory hidden by kaniko
 	# We create the directory below.
 	"-ldflags", " -X github.com/containers/image/v5/internal/tmpdir.unixTempDirForBigFiles=/workspace/tmp -X github.com/containers/image/v5/signature.systemDefaultPolicyPath=/kaniko/containers/policy.json -extldflags \"-static\" -w -s", \
 	"./cmd/skopeo"]
 
 FROM golang:1.14 as kaniko
 WORKDIR /go/src/
-RUN ["/usr/bin/git", "clone", "--no-checkout", "--depth=1", "--branch=v1.0.0", "https://github.com/GoogleContainerTools/kaniko", "."]
-RUN ["/usr/bin/git", "checkout", "146ec6a9cd6f87b4a12e8119ded575d5edca35ac"]
-RUN ["/usr/bin/make"]
+RUN ["git", "clone", "--no-checkout", "--depth=1", "--branch=v1.0.0", "https://github.com/GoogleContainerTools/kaniko", "."]
+RUN ["git", "checkout", "146ec6a9cd6f87b4a12e8119ded575d5edca35ac"]
+RUN ["make"]
 
 # Build the `build-image` command as a static binary using musl
 # The setup is loosely based on a stripped down version of
 # https://github.com/emk/rust-musl-builder/blob/master/Dockerfile
 FROM debian:buster as build-image
 
 COPY apt.conf /etc/apt/apt.conf.d/99taskcluster
 
@@ -67,17 +67,17 @@ RUN curl https://sh.rustup.rs -sSf | \
 RUN mkdir -p /home/rust/src
 WORKDIR /home/rust/src
 # Add our source code.
 ADD --chown=rust:rust build-image/ ./
 
 # --out-dir is not yet stable
 ENV RUSTC_BOOTSTRAP=1
 # Build our application.
-RUN ["/home/rust/.cargo/bin/cargo", "build", "--target", "x86_64-unknown-linux-musl", "--out-dir=bin", "--release", "-Zunstable-options"]
+RUN ["cargo", "build", "--target", "x86_64-unknown-linux-musl", "--out-dir=bin", "--release", "-Zunstable-options"]
 
 FROM scratch as empty
 
 FROM scratch
 
 COPY --from=skopeo /go/src/out/skopeo /kaniko-bootstrap/skopeo
 COPY --from=kaniko /go/src/out/executor /kaniko-bootstrap/executor
 COPY --from=build-image \