Docker compose does not convert secrets source path correctly while using docker toolbox (virtualbox).
Output of docker-compose version
docker-compose version 1.24.0dev, build unknown
docker-py version: 3.7.0
CPython version: 3.7.2
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
Output of docker version
Client:
Version: 18.09.2
API version: 1.39
Go version: go1.11.5
Git commit: 62479626f2
Built: Wed Feb 13 09:02:49 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.3
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 774a1f4
Built: Thu Feb 28 06:40:51 2019
OS/Arch: linux/amd64
Experimental: false
Output of docker-compose config
(Make sure to add the relevant -f
and other flags)
secrets:
password:
file: C:\Users\Joaom\teste\secrets\password
user:
file: C:\Users\Joaom\teste\secrets\user
services:
rice:
image: alpine:3.8
secrets:
- source: password
- source: user
version: '3.6'
Secrets are not mounted in the container, because compose is not converting path from Windows to unix Style correctly like it does for volumes.
secrets to be mounted successfully.
Creating network "teste_default" with the default driver
Creating teste_rice_1 ... error
ERROR: for teste_rice_1 Cannot create container for service rice: invalid mount config for type "bind": invalid mount path: 'C:/Users/Joaom/teste/secrets/password' mount path must be absolute
ERROR: for rice Cannot create container for service rice: invalid mount config for type "bind": invalid mount path: 'C:/Users/Joaom/teste/secrets/password' mount path must be absolute
ERROR: Encountered errors while bringing up the project.
Same problem here :) I hope the PR can be merged / released soon, thanks
After upgrading to the latest verison of docker toolbox for windows, the problem is gone, thanks for your work :):)
This was not merged yet. Did you implement my changes or did a new docker toolbox version came out?
I don't remember on which version I was, but I uninstalled, installed the last version of the toolbox n recreated my docker machine on VirtualBox as well and it's working.
Thanks for the report @jmadeira95 and @RemiBou!
@RemiBou can you please check which version of Compose you used?
here is my compose file https://github.com/RemiBou/Toss.Blazor/blob/master/docker-compose.yml (just comment the mac part on the secrets for the MS part), I didn't change the compose version. This evening I'll try to find the previous version of docker toolbox on my personal computer download folder. I installed it 1 year ago I'd say.
I am having this issue too. Any update on this?
@jmadeira95, have you tried replacing your paths to
C\:\\Users\\Joaom\\teste\\secrets\\password
C\:\\Users\\Joaom\\teste\\secrets\\user
or
Users/Joaom/teste/secrets/password
Users/Joaom/teste/secrets/user
Yes i did try that @Saw-mon-and-Natalie
For my case, I had to make sure the Virtual Box
my docker
runs on has access to those folders. You might need to create some shared folders.
cd C:/Program Files/Oracle/VirtualBox
# ^^ over wherever your VirtualBox binaries are located.
./VBoxManage.exe sharedfolder add default --name "path/to/mount/folder/on/docker/vm" --hostpath "\\?\x:\path\to\folder" --automount
default
in the command above is the name of the docker
virtual box. In your case you might need to type this:
./VBoxManage.exe sharedfolder add default --name "/c/Users/Joaom/teste" --hostpath "\\?\c:\Users\Joaom\teste" --automount
This article might help:
Docker Toolbox, Windows 7, and Shared Volumes
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
Sorry if I'm missing something, but if this has been closed, what is the solution to using secret files on Windows with Docker Toolbox?
Hi @Virakal,
I'd recommend using Docker Desktop for Windows instead of Docker Toolbox.
@chris-crone Thank you, but I'm afraid that's not an option for me because Hyper-V breaks other apps that I need. Does Compose not support Toolbox?
Hi @chris-crone, I experiences the same issue.
I'm using Windows 8.1 so I can only make use of Docker Toolbox.
@Virakal Compose should work with Toolbox but Docker Desktop is really the preferred way to run Docker on Windows. What app are you using that will break if you use Hyper-V?
@soma99 Curious why you're using Windows 8?
@chris-crone I need Virtualbox for various projects (I'm aware VBox can theoretically work with Hyper-V enabled but last time I tried it wouldn't work on most machines, including mine, and was reported to be extremely slow and unsupported); Vagrant, which I have tried with Hyper-V but found it to be an awful experience; and Android emulators, where the only Hyper-V compatible one I'm aware of doesn't perform well enough for my needs.
@chris-crone The last laptop I bought 5-6 years ago came with Windows 8 (OEM) and I've been using this laptop for local development since then. If I had a choice when I bought it back then, it would properly be running Windows 7, my preferred edition of Windows.
Given that there still seems to be no solution for this, is there a way to request this issue be repoened, or should I open a new issue linking to this one?
Most helpful comment
I am having this issue too. Any update on this?