mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Adds support for a memory flag to docker-compose build.
Signed-off-by: Samantha Miller <samantha.a.miller123@gmail.com>
This commit is contained in:
parent
d48002a09d
commit
a6cdd62726
9 changed files with 29 additions and 4 deletions
|
|
@ -584,6 +584,12 @@ class CLITestCase(DockerClientTestCase):
|
|||
result = self.dispatch(['build', '--no-cache'], None)
|
||||
assert 'shm_size: 96' in result.stdout
|
||||
|
||||
def test_build_memory_build_option(self):
|
||||
pull_busybox(self.client)
|
||||
self.base_dir = 'tests/fixtures/build-memory'
|
||||
result = self.dispatch(['build', '--no-cache', '--memory', '96m', 'service'], None)
|
||||
assert 'memory: 100663296' in result.stdout # 96 * 1024 * 1024
|
||||
|
||||
def test_bundle_with_digests(self):
|
||||
self.base_dir = 'tests/fixtures/bundle-with-digests/'
|
||||
tmpdir = pytest.ensuretemp('cli_test_bundle')
|
||||
|
|
|
|||
4
tests/fixtures/build-memory/Dockerfile
vendored
Normal file
4
tests/fixtures/build-memory/Dockerfile
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
FROM busybox
|
||||
|
||||
# Report the memory (through the size of the group memory)
|
||||
RUN echo "memory:" $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
|
||||
6
tests/fixtures/build-memory/docker-compose.yml
vendored
Normal file
6
tests/fixtures/build-memory/docker-compose.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
version: '3.5'
|
||||
|
||||
services:
|
||||
service:
|
||||
build:
|
||||
context: .
|
||||
|
|
@ -499,6 +499,7 @@ class ServiceTest(unittest.TestCase):
|
|||
target=None,
|
||||
shmsize=None,
|
||||
extra_hosts=None,
|
||||
container_limits={'memory': None},
|
||||
)
|
||||
|
||||
def test_ensure_image_exists_no_build(self):
|
||||
|
|
@ -541,6 +542,7 @@ class ServiceTest(unittest.TestCase):
|
|||
target=None,
|
||||
shmsize=None,
|
||||
extra_hosts=None,
|
||||
container_limits={'memory': None},
|
||||
)
|
||||
|
||||
def test_build_does_not_pull(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue