Skip to content

Commit

Permalink
Merge pull request #132 from crazy-max/fix-credential-helpers
Browse files Browse the repository at this point in the history
pkg(credential-helpers): match min macos version
  • Loading branch information
crazy-max authored Aug 3, 2023
2 parents 2c95ad0 + 528b65a commit 59f365a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/credential-helpers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

ARG XX_VERSION="1.2.1"
ARG OSXCROSS_VERSION="11.3-r7-debian"
ARG DEBIAN_FRONTEND="noninteractive"

# common args
Expand All @@ -35,8 +36,8 @@ FROM scratch AS common-scripts
# cross compilation helper
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

# osxcross contains the MacOSX SDK for xx
FROM dockercore/golang-cross:xx-sdk-extras AS osxsdk
# osxcross contains the MacOSX cross toolchain for xx
FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross

# go base image to retrieve /usr/local/go
FROM ${GO_IMAGE}:${GO_VERSION}-${GO_IMAGE_VARIANT} AS go
Expand Down Expand Up @@ -203,7 +204,7 @@ RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/p
--mount=type=bind,from=common-scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/credential-helpers \
--mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \
--mount=from=osxsdk,target=/xx-sdk,src=/xx-sdk \
--mount=type=bind,from=osxcross,src=/osxsdk,target=/xx-sdk \
OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/credential-helpers pkg-static-build

FROM builder-static-$TARGETOS AS builder-static
Expand Down
4 changes: 4 additions & 0 deletions pkg/credential-helpers/scripts/pkg-static-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ for l in $(gen-ver "${SRCDIR}"); do
export "${l?}"
done

pushd ${SRCDIR}
export "MACOSX_VERSION_MIN=$(make print-MACOSX_DEPLOYMENT_TARGET)"
popd

xx-go --wrap
fix-cc

Expand Down

0 comments on commit 59f365a

Please sign in to comment.