Skip to content

Conversation

@khimaros
Copy link

This adds support for the docker run --tmpfs flag as described in #2778

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" git@github.com:sllawap/compose.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Ammending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Philip Walls <pawalls@rabidgeek.com>
Signed-off-by: Philip Walls <pawalls@rabidgeek.com>
@khimaros
Copy link
Author

@GordonTheTurtle -- should be all set now. Sorry for the oversight; first time contributor!

@dato
Copy link

dato commented Mar 2, 2016

I tried to test this PR, because I wanted to check whether syntax like /tmp:size=10M or /home/foo/tmp:uid=NNN would work.

However, I did not manage to run the PR (see error below). I think support for tmpfs is needed in docker-py, maybe?

Consider the following docker-compose.yml:

version: "2"

services:
  test:
    image: busybox
    tmpfs: /run
    network_mode: none

I run:

$ env PYTHONPATH=. bin/docker-compose up test

It fails with:

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
    main()
  File ".../src/compose/compose/cli/main.py", line 56, in main
    command.sys_dispatch()
  […]
  File ".../src/compose/compose/service.py", line 648, in _get_container_host_config
    tmpfs=options.get('tmpfs'),
  File ".../Library/Python/Envs/compose/lib/python2.7/site-packages/docker/api/container.py", line 141, in create_host_config
    return utils.create_host_config(*args, **kwargs)
TypeError: create_host_config() got an unexpected keyword argument 'tmpfs'

I looked at the AppVeyor logs, but I didn’t see the test_tmp() test run, only the simpler test_tmpfs_option(). I don’t really know if it the test was supposed to catch it or not.

@dnephin dnephin added this to the 1.7.0 milestone Mar 7, 2016
'external_links',
'ports',
'volumes_from',
'tmpfs',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this can be a list or a string it needs to be in the list with dns and dns_search just below this line.

@dnephin
Copy link

dnephin commented Mar 9, 2016

Thanks for the PR!

I've left one comment about a fix.
You'll also need to rebase on master, squash to one commit, and make sure that commit is signed.

If this requires a specific pre-release version of docker-py you can update the required version in requirements.txt. We're currently using a pinned version, so you might not need to make any changes there.

@dnephin
Copy link

dnephin commented Mar 15, 2016

Carried in #3137

@dnephin dnephin closed this Mar 15, 2016
@khimaros
Copy link
Author

@dnephin sorry for neglecting this, I was on vacation. Thank you for pushing this through!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants