Open mikedld opened 2 years ago
Skaffold does not support cross platforms builds yet. We will be working on this feature soon in Q2 2022.
+1 on this issue, though the use case is slightly different.
Requests to with a remote builder like googleCloudBuild
allow the remote building to perform platform/architecture checks and implementations, avoiding the local skaffold environment limitations.
ie a local Dockerfile
that pulls FROM
a different platform/architecture image, does not prevent skaffold build
from running, since the build task is delegated to a remote builder with a different environment (Google Cloud Build.)
Skaffold is performing local Dockerfile
validation and enforcing platform rules, before sending context to the remote googleCloudBuilder
. As the local environment does not match the Dockerfile build chain, the parsing ONBUILD instructions
step errors out and halts the process.
Skaffold parameters/config allow to suppress the Dockerfile
onbuild inspection for FROM
chain, at least for platform architecture, when explicitly set and/or when a known remote building environment is used for building
ARG WINDOWS_VERSION=ltsc2019
FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}
[...]
skaffold build -vtrace
..
INFO[0000] Skaffold &{Version:v1.38.0 ConfigVersion:skaffold/v2beta28 GitVersion:
..
DEBU[0000] Using builder: google cloud subtask=-1 task=DevLoop
..
Checking cache...
TRAC[0000] Checking base image golang:1.16-alpine for ONBUILD triggers. subtask=-1 task=DevLoop
TRAC[0000] Checking base image mcr.microsoft.com/windows/servercore:ltsc2019 for ONBUILD triggers. subtask=-1 ..
TRAC[0000] --> GET https://mcr.microsoft.com/v2/windows/servercore/manifests/ltsc2019
..
TRAC[0000] {"schemaVersion":2,"mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","manifests":[{"mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":886,"digest":"sha256:704343b4035e7b249499354375eca8abb9c62746af06586013e91a7d4c0b033e","platform":{"architecture":"amd64","os":"windows","os.version":"10.0.17763.3046","os.features":["win32k"]}}]}
- us-central1-docker.pkg.dev/ticketingdevops-332715/devops-iac/test-go-http-basic: Error checking cache.
..
getting hash for artifact "us-central1-docker.pkg.dev/ticketingdevops-332715/devops-iac/test-go-http-basic": getting dependencies for "us-central1-docker.pkg.dev/ticketingdevops-332715/devops-iac/test-go-http-basic": parsing ONBUILD instructions: retrieving image "mcr.microsoft.com/windows/servercore:ltsc2019": no child with platform linux/amd64 in index mcr.microsoft.com/windows/servercore:ltsc2019
Skaffold version: 1.38.0 Operating system: Linux (Debian 12 rodete/amd64) Installed via: skaffold.dev Contents of skaffold.yaml:
apiVersion: skaffold/v2beta28
kind: Config
metadata:
name: test-win-go-http
build:
#artifacts:
# - image: win1
googleCloudBuild:
projectId: ticketingdevops-332715
timeout: 3600s
logging: GCS_ONLY
dockerImage: 'us-docker.pkg.dev/gke-windows-tools/docker-repo/gke-windows-builder:latest'
concurrency: 1
artifacts:
- image: windows-hello-sk
deploy:
kubectl:
manifests:
- kubernetes/manifest.yaml
Expected behavior
Building Windows container image on Linux (using
DOCKER_HOST
) succeeds.Actual behavior
Information
Steps to reproduce the behavior
See above.
Current workaround: