Skip to content

A sample Docker extension to demonstrate how to bind mount a dir to the extension container, and list the content of the bind-mounted file.

Notifications You must be signed in to change notification settings

felipecruz91/bind-mount-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bind-mount-extension

A sample Docker extension to demonstrate how to bind mount a dir to the extension container, and list the content of the bind-mounted file.

Getting started

Edit the docker-compose.yaml file to set the path of the host directory you want to bind-mount to the extension container.

Then, build and install the Docker Extension:

docker build -t felipecruz/bind-mount-extension:latest .
docker extension install felipecruz/bind-mount-extension:latest

Note that Docker Compose can expand the ~ sign (i.e. home), but in the context of extensions a relative path ./ won't work. That is because the path is relative to where the compose command is executed, which in the case of extensions, is at ~/Containers/com.docker.docker/Data/extensions/<your-extension>/vm (in MacOS).

Therefore you can bind-mount a directory using the ~ as follows:

    volumes:
      - ~/src/tmp/bind-mount-extension/data:/tmp

About

A sample Docker extension to demonstrate how to bind mount a dir to the extension container, and list the content of the bind-mounted file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published