Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: community.docker.docker_container --storage-opt #91

Closed
mujocloud opened this issue Feb 23, 2021 · 4 comments · Fixed by #93
Closed

Feature Request: community.docker.docker_container --storage-opt #91

mujocloud opened this issue Feb 23, 2021 · 4 comments · Fixed by #93

Comments

@mujocloud
Copy link

SUMMARY
Hi Team,

I would like to request a new feature addition to the docker_container module -
When we run a container there is an option to specify the size of the container's root volume docker run -itd --storage-opt
Please implement that in the docker_container module as well

ISSUE TYPE
Feature Idea
COMPONENT NAME
community.docker.docker_container module

ADDITIONAL INFORMATION
If the team could add this feature it would allow all docker containers running on XFS to have a pre-set amount of storage and not use up the entire system's storage
https://fabianlee.org/2020/01/15/docker-use-overlay2-with-an-xfs-backing-filesystem-to-limit-rootfs-size/

   tasks:
      - name: run container with rootfs size limit
        docker_container:
            name: "{{ container_name }}"
            image: "{{ image_name }}"
            detach: yes
            tty: yes
            state: started
           storage-opt: 
              - size: <size in GB>
           ports:
               - "{{ port }}"
@felixfontein
Copy link
Collaborator

create_host_config (https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_host_config) has an option storage_opt of type dict, so this would be a dictionary and not a list.

@felixfontein
Copy link
Collaborator

(Support has been added in docker-py 2.1.0 according to the changelog.)

@felixfontein
Copy link
Collaborator

resolved_by_pr #93

@mujocloud
Copy link
Author

Awesome!! Thanks a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants