skopeo
skopeo copied to clipboard
Help for overriding paths during build
in brew packaging, the paths have gone wrong at least twice now:
- https://github.com/Homebrew/homebrew-core/pull/47766
- https://github.com/Homebrew/homebrew-core/pull/45834
FATA[0000] Error loading trust policy: open /etc/containers/policy.json: no such file or directory
Is there anything from skopeo side that can be done to improve this?
For example support for building to use standard env variables or build from makefile and make arguments.
Or alias the build time configurable into namespace that does not change with each release for example to main module? config module?
"-X main.systemRegistriesDirPath=#{etc/"containers/registries.d"}",
"-X main.unixTempDirForBigFiles=/var/tmp",
"-X main.systemDefaultPolicyPath=#{etc/"containers/policy.json"}",
"-X main.systemRegistriesConfPath=#{etc/"containers/registries.conf"}",
also, perhaps skopeo --version --verbose
(or skypeo --config
, or skopeo config
)could output configured paths? so could use assert_match in brew formula test stage?
@lsm5 any tips?
Thanks for your report.
https://github.com/Homebrew/homebrew-core/pull/47766/files does indeed look painful — likely enough to happen again, and it fails silently.
In principle I think the skopeo Makefile
should be handling that, e.g. making sure the destinations used to install files (CONTAINERSSYSCONFIGDIR
and the like) and the paths hard-coded into the binary match. (It may impact integration tests, though.)
Figuring out the c/image major version component automatically within the Makefile should be possible as well. Testing that the overrides are applied and not ignored would, I suppose, happen through the integration tests “impacted” above.
@glensc @lsm5 Could you work together to open a PR to fix this issue. I opened a PR to fix Makefile handling of PREFIX and DESTDIR. https://github.com/containers/skopeo/pull/1168 What else needs to change? Seems like we could fix this one rather quickly.
This is also makes porting to FreeBSD harder - FreeBSD ports install files with PREFIX = /usr/local
and skopeo can't find configuration without manual intervention or setting ldflags.
@mateuszkwiatkowski Please open a PR to fix issues that you see. My PR was merged back in January, what other issues do you want fixed?
@rhatdan the issue here is that containers/image
doesn't respect $PREFIX
- it uses hardcoded value of /etc/containers
.
My proposition is to either look for config in both paths (/usr/local/etc/
, /etc
) or generate path during the build our of $PREFIX
. What do you think?
I don’t think that adding more hard-coded paths to c/image is going to make relocation any easier.
At the top level, Skopeo’s Makefile
should be setting the various -X
flags based on $PREFIX and other overrides; the user intent is clear from that.
That makes the discussion of what c/image should support ultimately less urgent. I could imagine another c/image variable (github.com/containers/image/v5/internal.{prefix,sysConfDir}
?) so that many users only need to set one or two values instead of several; I’m not immediately sure whether that would actually work as expected, or whether it is worth it.)
BTW c/image/docker.perHostCertDirs
hard-codes /etc
paths without a way to override; that should probably be fixed.
Hi @rhatdan and @mtrmac,
I addressed my problem in PR https://github.com/containers/skopeo/pull/1298. Please take a look if it's good to be merged. Thanks!
A friendly reminder that this issue had no activity for 30 days.
I addressed my problem in PR #1298. Please take a look if it's good to be merged. Thanks!
Since the PR #1298 has been closed, are we ok closing this issue?
Well it would still be a good idea (but low priority, sure) to make this easier; #1298 not being finished doesn’t mean the problem went away.
A friendly reminder that this issue had no activity for 30 days.