mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 23:18:41 +00:00
metadata: Allow simple string keys
If a file is a simple string (as opposed to a map) then write it with the default perms. This makes for slightly terser metadata when creating a simple datafile. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
@@ -29,10 +29,7 @@ For example, the following userdata file:
|
||||
}
|
||||
},
|
||||
"foo" : {
|
||||
"bar" : {
|
||||
"perm": "0644",
|
||||
"content": "foobar"
|
||||
},
|
||||
"bar" : "foobar",
|
||||
"baz" : {
|
||||
"perm": "0600",
|
||||
"content": "bar"
|
||||
@@ -47,6 +44,16 @@ will generate the following files:
|
||||
/var/config/foo/baz
|
||||
```
|
||||
|
||||
Each file can either be:
|
||||
|
||||
- a simple string (as for `foo/bar` above) in which case the file will
|
||||
be created with the given contents and read/write (but not execute)
|
||||
permissions for user and read permissions for group and everyone else (in octal format `0644`).
|
||||
- a map (as for `ssh/sshd_config` and `foo/baz` above) with the
|
||||
following mandatory keys:
|
||||
- `content`: the contents of the file.
|
||||
- `perm`: the permissions to create the file with.
|
||||
|
||||
This hierarchy can then be used by individual containers, who can bind
|
||||
mount the config sub-directory into their namespace where it is
|
||||
needed.
|
||||
|
Reference in New Issue
Block a user