I am having trouble with two-way folders with Docker.
defaultCfg.Mounts = append(ContainerHostConfig.Mounts, mount.Mount{
Type: mount.TypeVolume,
Source: fmt.Sprintf("/root%s", tmp),
Target: fmt.Sprintf("%s", tmp),
})
Source and target works when using bind (with CreateMountpoint being true on bind config), but on volume i have this error:
"failed to create container: Error response from daemon: create /root/tmp/metrics-60-1990068486: "/root/tmp/metrics-60-1990068486" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path"
"error is as descriptive as it can get"
"read the error"
"are you capable of reading"
If you intended to pass a host directory, use absolute path
isnt this absolute?
/root/tmp/metrics-60-1990068486
what is wrong?
>Solution :
Mounting a directory is called a bind mount, so you need to use mount.TypeBind instead of mount.TypeVolume.