-
Notifications
You must be signed in to change notification settings - Fork 60
common: create stdio symlinks if not present #97
Conversation
d15c1c2
to
4811117
Compare
} | ||
|
||
for name, target := range stdioSymlinks { | ||
if _, ok := filemap[name]; !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid one level of indentation, you could do
if _, exists := filemap[name]; exists {
continue
}
Did you try to run the image https://github.com/deis/example-dockerfile-http mentioned in rkt/rkt#1617? |
4811117
to
681282c
Compare
Now I start the pod and I connect to nginx from a browser:
|
Does it work if the original Docker image does not have the What if the original Docker image has a file |
Yes. Yes.
I guess it would either fail or follow the symlink depending on the order. We could error out if we find a |
ping? |
This wasn't implemented in the PR. It is now, we return an error if |
@@ -329,6 +329,7 @@ func writeACI(layer io.ReadSeeker, manifest schema.ImageManifest, curPwl []strin | |||
return nil, fmt.Errorf("error writing rootfs entry: %v", err) | |||
} | |||
|
|||
filemap := make(map[string]struct{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileMap
? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.. :D
LFAD. You can probably ignore the |
Docker images expect /dev/stdin, /dev/stdout, /dev/stderr and /dev/fd (https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#filesystem) but appc/spec doesn't (https://github.com/appc/spec/blob/master/spec/OS-SPEC.md#devices-and-file-systems). This adds the mentioned symlinks to the converted ACIs so apps can find them as expected.
Since docker2aci is creating stdio symlinks in /dev, a layer with a /dev that's not a directory can cause general badness. Return an error in that case.
0c34fb8
to
4cad36e
Compare
LFAD. |
Whitelist is often a word so |
common: create stdio symlinks if not present
Docker images expect /dev/stdin, /dev/stdout, /dev/stderr and /dev/fd
(https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#filesystem)
but appc/spec doesn't
(https://github.com/appc/spec/blob/master/spec/OS-SPEC.md#devices-and-file-systems).
This adds the mentioned symlinks to the converted ACIs so apps can find them as expected.
Fixes #96