docker / docker/docker-py

Documentation on mounting volumes

Open
#2,765 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

Hi,

I'm looking for ways to mount a volume in a container and found this documentation page, however, it's from an old version.

I tried to find the same section on the current docs but the volumes page does not contain the code snippet:

container_id = c.create_container(
    'busybox', 'ls', volumes=['/mnt/vol1', '/mnt/vol2'],
    host_config=docker.utils.create_host_config(binds=[
        '/home/user1/:/mnt/vol2',
        '/var/www:/mnt/vol1:ro',
    ])
)

Two questions:

  1. Is there any section in the current documentation where I can find a similar example?
  2. Is the code snippet still valid? I tested it and works fine, but I'd like to know if there are any changes I should be aware of

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the linked old volumes page with the current volumes page, then verify the shown create_container and create_host_config example against the current docker-py API. Done means the current documentation points to an equivalent volume-mounting example and explains any version-related changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.