CST does not support OCI, if OCI is enabled by dependency bump, windows build fails
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- docker, go
- Lĩnh vực
- build-system, operating-systems
Hướng nghiên cứu
Bắt đầu với go.mod và target trong Makefile được make cross sử dụng, sau đó kiểm tra đường dẫn dependency của github.com/docker/docker kết thúc tại pkg/system/filesys_windows.go. Tái hiện quá trình cross-build cho Windows và lệnh OCI của tar-driver với các phiên bản được hiển thị. Hoàn tất khi việc cập nhật dependency vẫn giữ hỗ trợ OCI và tạo ra một binary Windows thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
I try to use CST with OCI Images. Cause reasons, I MUST work without docker. Thus I use the --driver tar.
This does not seem to work with CST:
Error: error creating driver: retrieving image: MANIFEST_UNKNOWN: OCI manifest found, but accept header does not support OCI manifests
./container-structure-test test --driver tar --image harbor.<fqdn>/library/oci:test --config config.yaml
====================================
====== Test file: config.yaml ======
====================================
2020/08/06 20:37:04 Unable to read "/root/.docker/config.json": open /root/.docker/config.json: no such file or directory
=== RUN: Metadata Test
--- FAIL
duration: 0s
Error: error creating driver: retrieving image: MANIFEST_UNKNOWN: OCI manifest found, but accept header does not support OCI manifests
=====================================
============== RESULTS ==============
=====================================
Passes: 0
Failures: 1
Duration: 0s
Total tests: 1
FAIL
FATA[0000] FAIL
I did some research, fetched the sourcecode, updated the dependency github.com/google/go-containerregistry to v.0.1.1 and make cross within a go1.9 container
module github.com/GoogleContainerTools/container-structure-test
go 1.14
require (
github.com/GoogleContainerTools/container-diff v0.14.1-0.20190219205308-3f6b025c016c
github.com/Microsoft/hcsshim v0.8.9 // indirect
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/bshuster-repo/logrus-logstash-hook v0.4.1 // indirect
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd // indirect
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b // indirect
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 // indirect
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba // indirect
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916 // indirect
github.com/fsouza/go-dockerclient v1.3.6
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7 // indirect
github.com/google/go-cmp v0.4.1
github.com/google/go-containerregistry v0.1.1
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33 // indirect
github.com/marstr/guid v1.1.0 // indirect
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f // indirect
github.com/ncw/swift v1.0.47 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 // indirect
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 // indirect
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f // indirect
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 // indirect
gopkg.in/yaml.v2 v2.3.0
)
This results in:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T21:30:33Z " -o out/container-structure-test-linux-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
sha256sum out/container-structure-test-linux-amd64 &> out/container-structure-test-linux-amd64.sha256
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T21:30:33Z " -o out/container-structure-test-darwin-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
ad913da4a1d6603b48fa789a5a5903ff3ee2eb76ff2a2c9fbf2169908e72c40e out/container-structure-test-linux-amd64
sha256sum out/container-structure-test-darwin-amd64 &> out/container-structure-test-darwin-amd64.sha256
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T21:30:33Z " -o out/container-structure-test-windows-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
dfbfe003583538457dc8ca9ad725ebdf99e60d4e806c5fc6d69e3198bcaadb7d out/container-structure-test-darwin-amd64
cp out/container-structure-test-windows-amd64 out/container-structure-test-windows-amd64.exe
sha256sum out/container-structure-test-windows-amd64.exe &> out/container-structure-test-windows-amd64.exe.sha256
rm out/container-structure-test-windows-amd64
The resulting binary does NOT fix the issue. So the error persists.
when I build the same code with go version go1.13.4 linux/amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T23:39:23Z " -o out/container-structure-test-linux-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
sha256sum out/container-structure-test-linux-amd64 &> out/container-structure-test-linux-amd64.sha256
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T23:39:23Z " -o out/container-structure-test-darwin-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
sha256sum out/container-structure-test-darwin-amd64 &> out/container-structure-test-darwin-amd64.sha256
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags " -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=v1.9.0 -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate=2020-08-06T23:39:23Z " -o out/container-structure-test-windows-amd64 github.com/GoogleContainerTools/container-structure-test/cmd/container-structure-test
# github.com/docker/docker/pkg/system
/root/go/pkg/mod/github.com/docker/[email protected]/pkg/system/filesys_windows.go:112:24: cannot use uintptr(unsafe.Pointer(&sd[0])) (type uintptr) as type *"golang.org/x/sys/windows".SECURITY_DESCRIPTOR in assignment
make: *** [Makefile:51: out/container-structure-test-windows-amd64] Error 2
so the windows binary fails. This seems to be caused by https://github.com/golang/go/issues/34610
BUT my issue is fixed!
./container-structure-test-linux-amd64 test --driver tar --image harbor.<fqdn>/library/oci:test --config config.yaml
====================================
====== Test file: config.yaml ======
====================================
=== RUN: Metadata Test
--- FAIL
duration: 0s
Error: label built-date not found in image metadata
=====================================
============== RESULTS ==============
=====================================
Passes: 0
Failures: 1
Duration: 0s
Total tests: 1
FAIL
FATA[0005] FAIL
Since I don't use windows it is ok for me. I guess I need to bump a dependency which depends on /docker/[email protected]
But since the changed line in the dependencies is the only line I ever did in a go - programm I am unable to find the correct dependency.
I am willing to dig into this more, but need some fingerpoints to help me.
And if someone has an explanation, why the functionality is so different with different go versions I would be thankful.
--sluetze
- Ngôn ngữ chính
- Go
- Star
- 2.5k
- Fork
- 213
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GoogleContainerTools/container-structure-test
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
allstar
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
GoogleContainerTools/container-structure-test#393 · 639 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GoogleContainerTools/container-structure-test#280 · 1 reaction ·
-
go.mod pins vulnerable docker/containerd modules; two open Dependabot PRs clear most findingsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Windows: structure_test binary missing .exe extension causes "Open With" dialog instead of running testsCó thể đã có người làm @peakschris đã nhận 145 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Tất cả issue của GoogleContainerTools/container-structure-test
Issue tương tự
-
bug converter
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
grafana/sigma-rule-deployment#435 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/go-containerregistry#2491 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stranded-follow-up sweep trusts any issue whose body carries the marker as the tracking issueĐang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nightgauge/nightgauge#2688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aiac enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày