Comments (3)
After some experimenting, we found this is not fixable in imgutil
. The only valid type of value for header.LinkName
would be a relative path (ex my-link => bin/detect
) and those already work without a Files
prefix.
Absolute paths also don't work for Linux tar.Writer (they're copied over completely and not rewritten by Docker on extraction) so likewise on Windows, a user would need to set the correct absolute path value for header.Linkname
.
Here are some examples from pack
. We added some different types of symlinks to a sample buildpack, created a builder image from them, then got this output via docker run
on that builder image. Note that both Windows and Linux have identical behavior (they just set the generated symlinks to have the exact values of the original symlinks).
Windows:
12/31/1979 05:00 PM <DIR> bin
12/31/1979 05:00 PM 162 buildpack.toml
12/31/1979 05:00 PM <SYMLINK> dirlink-absolute-bin [\Users\micah\workspace\pack\sandbox\hello-windows\bin]
12/31/1979 05:00 PM <SYMLINK> dirlink-absolute-buildpack.toml [\Users\micah\workspace\pack\sandbox\hello-windows\buildpack.toml]
12/31/1979 05:00 PM <SYMLINK> dirlink-relative-bin [bin]
12/31/1979 05:00 PM <SYMLINK> dirlink-relative-buildpack.toml [buildpack.toml]
12/31/1979 05:00 PM <SYMLINK> dirlink-relback-bin [..\hello-windows\bin]
12/31/1979 05:00 PM <SYMLINK> dirlink-relback-buildpack.toml [..\hello-windows\buildpack.toml]
Linux:
drwxr-xr-x 2 root root 4096 Jan 1 1980 bin
-rwxr-xr-x 1 root root 162 Jan 1 1980 buildpack.toml
lrwxrwxrwx 1 root root 53 Jan 1 1980 dirlink-absolute-bin -> /Users/micah/workspace/pack/sandbox/hello-windows/bin
lrwxrwxrwx 1 root root 64 Jan 1 1980 dirlink-absolute-buildpack.toml -> /Users/micah/workspace/pack/sandbox/hello-windows/buildpack.toml
lrwxrwxrwx 1 root root 3 Jan 1 1980 dirlink-relative-bin -> bin
lrwxrwxrwx 1 root root 14 Jan 1 1980 dirlink-relative-buildpack.toml -> buildpack.toml
lrwxrwxrwx 1 root root 20 Jan 1 1980 dirlink-relback-bin -> ../hello-windows/bin
lrwxrwxrwx 1 root root 31 Jan 1 1980 dirlink-relback-buildpack.toml -> ../hello-windows/buildpack.toml
from imgutil.
Absolute paths also don't work for Linux tar.Writer (they're copied over completely and not rewritten by Docker on extraction) so likewise on Windows, a user would need to set the correct absolute path value for header.Linkname.
Can you elaborate on this part a little. If you explicitly set header.Linkname
to an absolute path that will exist in the container, docker
will not handle it correctly when creating the container?
from imgutil.
Sorry for no reply. I'm afraid I lost the context on this and I feel like this has been sorted out with the slice-related lifecycle
changes, so incoming symlinks are sure to have the correct value on both OSes
from imgutil.
Related Issues (20)
- Support Saving images as archives.
- Should we limit the number of bytes in an image?
- Continue with test cleanup if previous cleanup fails
- Create an archive package in imgutil that exposes the ReadXAsTar functions
- fakes package should expose a way to create a non-existent image HOT 3
- Implement cnb.Image interface using OCI layout format
- Expose a method to parse an image reference into a local path
- Implement the SaveFile() method in the layout image interface
- Add annotation `org.opencontainers.image.ref.name` when image in OCI layout is saved
- Add annotation org.opencontainers.image.ref.name when Remote image is saved
- Expose a method to parse an image layout identifier
- Create an new interface to handle Manifest Lists
- imgutil images should be v1.Images HOT 3
- NewImage constructors should allow overriding default image properties HOT 1
- Revert docker version upgrade HOT 1
- Add codecov support HOT 1
- Update GitHub Actions workflows to use environment files
- Fallback to slow behavior if writing to daemon fails with performance optimization
- local.Rebase/ReuseLayer leak temp files HOT 2
- Add ability to override v1Config() function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgutil.