Skip to content

Invalid argument for "--mount" flag: unexpected key ''type' in ''type=bind' #4

@mikeoutlaw

Description

@mikeoutlaw

The Docker run command mentioned in the README, docker run --rm -p 8888:8888 -e JUPYTER_LAB_ENABLE=yes --mount 'type=bind,src='"$(pwd)"'/app,target=/home/jovyan/work' jupyter/scipy-notebook:8ccdfc1da8d5, doesn't work on Windows (Command Shell or PowerShell).

C:\Temp\data_science_workshop>docker run --rm -p 8888:8888 -e JUPYTER_LAB_ENABLE=yes --mount 'type=bind,src='"$(pwd)"'/app,target=/home/jovyan/work' jupyter/scipy-notebook:8ccdfc1da8d5
invalid argument "'type=bind,src='$(pwd)'/app,target=/home/jovyan/work'" for "--mount" flag: unexpected key ''type' in ''type=bind'
See 'docker run --help'.

For Command Prompt, %cd% returns the current directory, but $(pwd) works in PowerShell, so it might be best to recommend PowerShell to keep the command generic.

However, regardless of %cd% vs $(pwd) or Command Prompt vs PowerShell, neither like the --mount value being in a single quote.

The following gets me closer:

  • Command Prompt
    • docker run --rm -p 8888:8888 -e JUPYTER_LAB_ENABLE=yes --mount type=bind,source="%cd%\app",target=/home/jovyan/work jupyter/scipy-notebook:8ccdfc1da8d5
      • This starts the container, but isn't actually mounting the volume, i.e. the /work directory is empty when viewed within Jupyter.
  • PowerShell
    • docker run --rm -p 8888:8888 -e JUPYTER_LAB_ENABLE=yes --mount type=bind,src="$(pwd)/ app",target=/home/jovyan/work jupyter/scipy-notebook:8ccdfc1da8d5
      • This returns a path, but not the expected path.
        • Error response from daemon: invalid mount config for type "bind": bind mount source path does not exist: /host_mnt/c/temp/data_science_workshop/app.

Versions:

  • Windows 10 Enterprise 1803 (build 17134.285)
  • Docker 18.06.1-ce-win73 (19507)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions