GoogleContainerTools / GoogleContainerTools/skaffold

Skaffold tried to pull image for wrong plaform

Open
#9,161 4 comments 3 reactions 0 assignees View on GitHub
area/build area/cache has-workaround kind/bug platform/windows
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
"skaffold build" should work on my skaffold yaml

### Actual behavior
Skaffold failed to pull remote image:

Generating tags...
- my-image -> my-image:latest
Some taggers failed. Rerun with -vdebug for errors.
Checking cache...
- my-image: Error checking cache.
getting hash for artifact "my-image": getting dependencies for "my-image": parsing ONBUILD instructions: retrieving image "mcr.microsoft.com/dotnet/framework/wcf:latest": no child with platform linux/amd64 in index mcr.microsoft.com/dotnet/framework/wcf:latest

When I execute "docker pull mcr.microsoft.com/dotnet/framework/wcf:latest" it worked

### Information

- Operating system: Windows 2019
- Installed via: https://storage.googleapis.com/skaffold/releases/latest/skaffold-windows-amd64.exe
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v4beta4
kind: Config
build:
artifacts:
- image: my-image
context: .
docker:
dockerfile: ./Dockerfile
platforms:
- windows
```
Dockerfile:
`
FROM mcr.microsoft.com/dotnet/framework/wcf:latest
`
### Steps to reproduce the behavior

run "skaffold build"

Root cause:
When code retrive image from remote - https://github.com/GoogleContainerTools/skaffold/blob/85de8d7a9b394ec8b3f3a4a4fef1463fb628dfb6/pkg/skaffold/docker/image.go#L299 It doesn't use any platform that it get from caller, but v1.Platform{}, so client try to pull images for default plafrom, mean linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.