Pin test images on a non rolling tag

Mainly busybox:latest to the current latest which is 1.31.0-uclibc

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
This commit is contained in:
Ulysses Souza 2019-07-15 18:56:04 +02:00
parent c8279bc4db
commit cd098e0cad
65 changed files with 222 additions and 210 deletions

View File

@ -20,6 +20,7 @@ import yaml
from docker import errors
from .. import mock
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from ..helpers import create_host_file
from compose.cli.command import get_project
from compose.config.errors import DuplicateOverrideFileFound
@ -266,7 +267,7 @@ class CLITestCase(DockerClientTestCase):
'volumes_from': ['service:other:rw'],
},
'other': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'volumes': ['/data'],
},
@ -639,7 +640,7 @@ class CLITestCase(DockerClientTestCase):
def test_pull_with_digest(self):
result = self.dispatch(['-f', 'digest.yml', 'pull', '--no-parallel'])
assert 'Pulling simple (busybox:latest)...' in result.stderr
assert 'Pulling simple ({})...'.format(BUSYBOX_IMAGE_WITH_TAG) in result.stderr
assert ('Pulling digest (busybox@'
'sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b520'
'04ee8502d)...') in result.stderr
@ -650,7 +651,7 @@ class CLITestCase(DockerClientTestCase):
'pull', '--ignore-pull-failures', '--no-parallel']
)
assert 'Pulling simple (busybox:latest)...' in result.stderr
assert 'Pulling simple ({})...'.format(BUSYBOX_IMAGE_WITH_TAG) in result.stderr
assert 'Pulling another (nonexisting-image:latest)...' in result.stderr
assert ('repository nonexisting-image not found' in result.stderr or
'image library/nonexisting-image:latest not found' in result.stderr or
@ -777,6 +778,7 @@ class CLITestCase(DockerClientTestCase):
]
assert not containers
@pytest.mark.xfail(True, reason='Flaky on local')
def test_build_rm(self):
containers = [
Container.from_ps(self.project.client, c)

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: ls .

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: ls /thecakeisalie

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
LABEL com.docker.compose.test_image=true
ARG favorite_th_character
RUN echo "Favorite Touhou Character: ${favorite_th_character}"

View File

@ -1,3 +1,3 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
LABEL com.docker.compose.test_image=true
CMD echo "success"

View File

@ -1,4 +1,4 @@
FROM busybox
FROM busybox:1.31.0-uclibc
# Report the memory (through the size of the group memory)
RUN echo "memory:" $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
RUN echo a
CMD top

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
RUN echo b
CMD top

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
LABEL com.docker.compose.test_image=true
VOLUME /data
CMD top

View File

@ -1,10 +1,10 @@
web:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 100"
links:
- db
db:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 200"

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: echo simple
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: echo another

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
LABEL com.docker.compose.test_image=true
ENTRYPOINT ["printf"]
CMD ["default", "args"]

View File

@ -1,5 +1,5 @@
service:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
environment:

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "echo hello && tail -f /dev/null"
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: /bin/false

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
expose:
- '3000'

View File

@ -1,2 +1,2 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
RUN touch /foo

View File

@ -1,9 +1,9 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
log_driver: "none"
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
log_driver: "json-file"
log_opt:

View File

@ -1,12 +1,12 @@
version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
logging:
driver: "none"
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
logging:
driver: "json-file"

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "sleep 1 && echo hello && tail -f /dev/null"
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "sleep 1 && echo test"

View File

@ -1,7 +1,7 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "echo hello && tail -f /dev/null"
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "sleep 2 && echo world && /bin/false"
restart: "on-failure:2"

View File

@ -1,3 +1,3 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c "echo w && echo x && echo y && echo z"

View File

@ -1,3 +1,3 @@
definedinyamlnotyml:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,3 +1,3 @@
yetanother:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,10 +1,10 @@
version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
networks:
default:

View File

@ -1,10 +1,10 @@
version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
networks:
default:

View File

@ -1,9 +1,9 @@
db:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
web:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
console:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,10 +1,10 @@
version: '2.2'
services:
web:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 200"
depends_on:
- db
db:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 200"

View File

@ -6,5 +6,5 @@ services:
- other
other:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "top"

View File

@ -1,10 +1,10 @@
web:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 100"
links:
- db
db:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: "sleep 200"

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: /bin/sleep 300
ports:
- '3000'

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
ports:
- '3000'

View File

@ -1,7 +1,7 @@
version: '3.2'
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
ports:
- target: 3000

View File

@ -1,5 +1,5 @@
with_image:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
with_build:
build: ../build-ctx/

View File

@ -1,5 +1,5 @@
service:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
labels:

View File

@ -1,4 +1,4 @@
service:
image: busybox:latest
image: busybox:1.31.0-uclibc
working_dir: /etc
command: /bin/true

View File

@ -1,7 +1,7 @@
version: '2.2'
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
volumes:
- datastore:/data1

View File

@ -1,2 +1,2 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc

View File

@ -1,5 +1,5 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
digest:
image: busybox@sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b52004ee8502d

View File

@ -2,5 +2,5 @@ simple:
image: busybox:1.27.2
command: top
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,5 +1,5 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
another:
image: nonexisting-image:latest

View File

@ -7,5 +7,5 @@ services:
from_simple:
image: simple
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
LABEL com.docker.compose.test_image=true
LABEL com.docker.compose.test_failing_image=true
# With the following label the container wil be cleaned up automatically

View File

@ -3,8 +3,8 @@ version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sleep 200
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sleep 200

View File

@ -1,5 +1,5 @@
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command:
- sh
- '-c'

View File

@ -1,2 +1,2 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
RUN touch /blah

View File

@ -1,6 +1,6 @@
service_a:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
service_b:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,7 +1,7 @@
version: '2'
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: sh -c 'echo $$FOO'
environment:
FOO: ${BAR}

View File

@ -1,4 +1,4 @@
service:
image: busybox:latest
image: busybox:1.31.0-uclibc
user: notauser
command: id

View File

@ -1,13 +1,13 @@
version: "2.0"
services:
db:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
web:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
depends_on:
- db
console:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,4 +1,4 @@
FROM busybox:latest
FROM busybox:1.31.0-uclibc
RUN echo something
CMD top

View File

@ -18,7 +18,7 @@ services:
- other
other:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
volumes:
- /data

View File

@ -1,10 +1,10 @@
version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top
links:
- another
another:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -1,5 +1,5 @@
version: "2"
services:
simple:
image: busybox:latest
image: busybox:1.31.0-uclibc
command: top

View File

@ -7,6 +7,10 @@ from compose.config.config import ConfigDetails
from compose.config.config import ConfigFile
from compose.config.config import load
BUSYBOX_IMAGE_NAME = 'busybox'
BUSYBOX_DEFAULT_TAG = '1.31.0-uclibc'
BUSYBOX_IMAGE_WITH_TAG = '{}:{}'.format(BUSYBOX_IMAGE_NAME, BUSYBOX_DEFAULT_TAG)
def build_config(contents, **kwargs):
return load(build_config_details(contents, **kwargs))
@ -22,7 +26,7 @@ def build_config_details(contents, working_dir='working_dir', filename='filename
def create_custom_host_file(client, filename, content):
dirname = os.path.dirname(filename)
container = client.create_container(
'busybox:latest',
BUSYBOX_IMAGE_WITH_TAG,
['sh', '-c', 'echo -n "{}" > {}'.format(content, filename)],
volumes={dirname: {}},
host_config=client.create_host_config(

View File

@ -20,7 +20,7 @@ class EnvironmentTest(DockerClientTestCase):
cls.compose_file.write(bytes("""version: '3.2'
services:
svc:
image: busybox:latest
image: busybox:1.31.0-uclibc
environment:
TEST_VARIABLE: ${TEST_VARIABLE}""", encoding='utf-8'))
cls.compose_file.flush()

View File

@ -15,6 +15,7 @@ from docker.errors import NotFound
from .. import mock
from ..helpers import build_config as load_config
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from ..helpers import create_host_file
from .testcases import DockerClientTestCase
from .testcases import SWARM_SKIP_CONTAINERS_ALL
@ -128,11 +129,11 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'data': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': ['/var/data'],
},
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': ['data'],
},
}),
@ -145,7 +146,7 @@ class ProjectTest(DockerClientTestCase):
def test_volumes_from_container(self):
data_container = Container.create(
self.client,
image='busybox:latest',
image=BUSYBOX_IMAGE_WITH_TAG,
volumes=['/var/data'],
name='composetest_data_container',
labels={LABEL_PROJECT: 'composetest'},
@ -155,7 +156,7 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': ['composetest_data_container'],
},
}),
@ -174,11 +175,11 @@ class ProjectTest(DockerClientTestCase):
'version': str(V2_0),
'services': {
'net': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"]
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'network_mode': 'service:net',
'command': ["top"]
},
@ -202,7 +203,7 @@ class ProjectTest(DockerClientTestCase):
'version': str(V2_0),
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'network_mode': 'container:composetest_net_container'
},
},
@ -217,7 +218,7 @@ class ProjectTest(DockerClientTestCase):
net_container = Container.create(
self.client,
image='busybox:latest',
image=BUSYBOX_IMAGE_WITH_TAG,
name='composetest_net_container',
command='top',
labels={LABEL_PROJECT: 'composetest'},
@ -237,11 +238,11 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'net': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"]
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'net': 'container:net',
'command': ["top"]
},
@ -262,7 +263,7 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'net': 'container:composetest_net_container'
},
}),
@ -276,7 +277,7 @@ class ProjectTest(DockerClientTestCase):
net_container = Container.create(
self.client,
image='busybox:latest',
image=BUSYBOX_IMAGE_WITH_TAG,
name='composetest_net_container',
command='top',
labels={LABEL_PROJECT: 'composetest'},
@ -549,20 +550,20 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'console': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
},
'data': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"]
},
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
'volumes_from': ['data'],
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
'links': ['db'],
},
@ -584,20 +585,20 @@ class ProjectTest(DockerClientTestCase):
name='composetest',
config_data=load_config({
'console': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
},
'data': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"]
},
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
'volumes_from': ['data'],
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': ["top"],
'links': ['db'],
},
@ -623,7 +624,7 @@ class ProjectTest(DockerClientTestCase):
'version': '2.1',
'services': {
'foo': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'tmpfs': ['/dev/shm'],
'volumes': ['/dev/shm']
}
@ -664,7 +665,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'networks': {
'foo': None,
@ -709,7 +710,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {'front': None},
}],
networks={
@ -769,7 +770,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {'front': None},
}],
networks={
@ -804,7 +805,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'networks': {
'static_test': {
@ -856,7 +857,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_3,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {
'n1': {
'priority': p1,
@ -919,7 +920,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'networks': {
'static_test': {
@ -962,7 +963,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {
'static_test': {
'ipv4_address': '172.16.100.100',
@ -998,7 +999,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {
'linklocaltest': {
'link_local_ips': ['169.254.8.8']
@ -1035,7 +1036,7 @@ class ProjectTest(DockerClientTestCase):
'name': 'web',
'volumes': [VolumeSpec.parse('foo:/container-path')],
'networks': {'foo': {}},
'image': 'busybox:latest'
'image': BUSYBOX_IMAGE_WITH_TAG
}],
networks={
'foo': {
@ -1071,7 +1072,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'isolation': 'default'
}],
)
@ -1091,7 +1092,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'isolation': 'foobar'
}],
)
@ -1111,7 +1112,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_3,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'runtime': 'runc'
}],
)
@ -1131,7 +1132,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_3,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'runtime': 'foobar'
}],
)
@ -1151,7 +1152,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_3,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'runtime': 'nvidia'
}],
)
@ -1171,7 +1172,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {'internal': None},
}],
networks={
@ -1200,7 +1201,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {network_name: None}
}],
networks={
@ -1233,7 +1234,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {'driver': 'local'}},
@ -1260,7 +1261,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': [VolumeSpec.parse('{}:/data'.format(volume_name))]
}],
volumes={
@ -1299,9 +1300,9 @@ class ProjectTest(DockerClientTestCase):
{
'version': str(V2_0),
'services': {
'simple': {'image': 'busybox:latest', 'command': 'top'},
'simple': {'image': BUSYBOX_IMAGE_WITH_TAG, 'command': 'top'},
'another': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'logging': {
'driver': "json-file",
@ -1352,7 +1353,7 @@ class ProjectTest(DockerClientTestCase):
'version': str(V2_0),
'services': {
'simple': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'ports': ['1234:1234']
},
@ -1386,7 +1387,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_2,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'scale': 3
}]
@ -1416,7 +1417,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {}},
@ -1440,7 +1441,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {}},
@ -1464,7 +1465,7 @@ class ProjectTest(DockerClientTestCase):
version=V3_1,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'cat /run/secrets/special',
'secrets': [
types.ServiceSecret.parse({'source': 'super', 'target': 'special'}),
@ -1502,7 +1503,7 @@ class ProjectTest(DockerClientTestCase):
'services': [
{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'cat /run/secrets/special',
'environment': ['constraint:node=={}'.format(node if node is not None else '')]
}
@ -1555,7 +1556,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {'driver': 'foobar'}},
@ -1578,7 +1579,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {'driver': 'local'}},
@ -1620,7 +1621,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={
@ -1662,7 +1663,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={vol_name: {'driver': 'local'}},
@ -1701,7 +1702,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={
@ -1725,7 +1726,7 @@ class ProjectTest(DockerClientTestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top'
}],
volumes={
@ -1753,7 +1754,7 @@ class ProjectTest(DockerClientTestCase):
'version': str(V2_0),
'services': {
'simple': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'volumes': ['{0}:/data'.format(vol_name)]
},
@ -1782,7 +1783,7 @@ class ProjectTest(DockerClientTestCase):
def test_project_up_orphans(self):
config_dict = {
'service1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
}
}
@ -1819,7 +1820,7 @@ class ProjectTest(DockerClientTestCase):
def test_project_up_ignore_orphans(self):
config_dict = {
'service1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
}
}
@ -1847,7 +1848,7 @@ class ProjectTest(DockerClientTestCase):
'version': '2.1',
'services': {
'svc1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'healthcheck': {
'test': 'exit 0',
@ -1857,7 +1858,7 @@ class ProjectTest(DockerClientTestCase):
},
},
'svc2': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'depends_on': {
'svc1': {'condition': 'service_healthy'},
@ -1884,7 +1885,7 @@ class ProjectTest(DockerClientTestCase):
'version': '2.1',
'services': {
'svc1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'healthcheck': {
'test': 'exit 1',
@ -1894,7 +1895,7 @@ class ProjectTest(DockerClientTestCase):
},
},
'svc2': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'depends_on': {
'svc1': {'condition': 'service_healthy'},
@ -1923,14 +1924,14 @@ class ProjectTest(DockerClientTestCase):
'version': '2.1',
'services': {
'svc1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'healthcheck': {
'disable': True
},
},
'svc2': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'depends_on': {
'svc1': {'condition': 'service_healthy'},
@ -1967,7 +1968,7 @@ class ProjectTest(DockerClientTestCase):
'version': '2.3',
'services': {
'svc1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'security_opt': ['seccomp:"{}"'.format(profile_path)]
}
@ -1991,7 +1992,7 @@ class ProjectTest(DockerClientTestCase):
'version': '2.3',
'services': {
'svc1': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'ls',
'volumes': ['foo:/foo:rw'],
'networks': ['bar'],

View File

@ -15,6 +15,7 @@ from six import StringIO
from six import text_type
from .. import mock
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from .testcases import docker_client
from .testcases import DockerClientTestCase
from .testcases import get_links
@ -373,7 +374,7 @@ class ServiceTest(DockerClientTestCase):
self.client.create_volume(volume_name)
service = Service('db', client=client, volumes=[
MountSpec(type='volume', source=volume_name, target=container_path)
], image='busybox:latest', command=['top'], project='composetest')
], image=BUSYBOX_IMAGE_WITH_TAG, command=['top'], project='composetest')
container = service.create_container()
service.start_container(container)
mount = container.get_mount(container_path)
@ -388,7 +389,7 @@ class ServiceTest(DockerClientTestCase):
container_path = '/container-tmpfs'
service = Service('db', client=client, volumes=[
MountSpec(type='tmpfs', target=container_path)
], image='busybox:latest', command=['top'], project='composetest')
], image=BUSYBOX_IMAGE_WITH_TAG, command=['top'], project='composetest')
container = service.create_container()
service.start_container(container)
mount = container.get_mount(container_path)
@ -474,7 +475,7 @@ class ServiceTest(DockerClientTestCase):
volume_container_1 = volume_service.create_container()
volume_container_2 = Container.create(
self.client,
image='busybox:latest',
image=BUSYBOX_IMAGE_WITH_TAG,
command=["top"],
labels={LABEL_PROJECT: 'composetest'},
host_config={},
@ -1232,9 +1233,8 @@ class ServiceTest(DockerClientTestCase):
# })
def test_create_with_image_id(self):
# Get image id for the current busybox:latest
pull_busybox(self.client)
image_id = self.client.inspect_image('busybox:latest')['Id'][:12]
image_id = self.client.inspect_image(BUSYBOX_IMAGE_WITH_TAG)['Id'][:12]
service = self.create_service('foo', image=image_id)
service.create_container()

View File

@ -10,6 +10,7 @@ import copy
import py
from docker.errors import ImageNotFound
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from .testcases import DockerClientTestCase
from .testcases import get_links
from .testcases import no_cluster
@ -42,8 +43,8 @@ class BasicProjectTest(ProjectTestCase):
super(BasicProjectTest, self).setUp()
self.cfg = {
'db': {'image': 'busybox:latest', 'command': 'top'},
'web': {'image': 'busybox:latest', 'command': 'top'},
'db': {'image': BUSYBOX_IMAGE_WITH_TAG, 'command': 'top'},
'web': {'image': BUSYBOX_IMAGE_WITH_TAG, 'command': 'top'},
}
def test_no_change(self):
@ -99,16 +100,16 @@ class ProjectWithDependenciesTest(ProjectTestCase):
self.cfg = {
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
'links': ['db'],
},
'nginx': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
'links': ['web'],
},
@ -173,7 +174,7 @@ class ProjectWithDependenciesTest(ProjectTestCase):
def test_service_removed_while_down(self):
next_cfg = {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
},
'nginx': self.cfg['nginx'],
@ -219,16 +220,16 @@ class ProjectWithDependsOnDependenciesTest(ProjectTestCase):
'version': '2',
'services': {
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
},
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
'depends_on': ['db'],
},
'nginx': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'tail -f /dev/null',
'depends_on': ['web'],
},
@ -385,7 +386,7 @@ class ServiceStateTest(DockerClientTestCase):
assert ('recreate', [container]) == web.convergence_plan()
def test_trigger_recreate_with_nonexistent_image_tag(self):
web = self.create_service('web', image="busybox:latest")
web = self.create_service('web', image=BUSYBOX_IMAGE_WITH_TAG)
container = web.create_container()
web = self.create_service('web', image="nonexistent-image")

View File

@ -9,6 +9,7 @@ from docker.errors import APIError
from docker.utils import version_lt
from .. import unittest
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from compose.cli.docker_client import docker_client
from compose.config.config import resolve_environment
from compose.config.environment import Environment
@ -32,7 +33,7 @@ SWARM_ASSUME_MULTINODE = os.environ.get('SWARM_ASSUME_MULTINODE', '0') != '0'
def pull_busybox(client):
client.pull('busybox:latest', stream=False)
client.pull(BUSYBOX_IMAGE_WITH_TAG, stream=False)
def get_links(container):
@ -123,7 +124,7 @@ class DockerClientTestCase(unittest.TestCase):
def create_service(self, name, **kwargs):
if 'image' not in kwargs and 'build' not in kwargs:
kwargs['image'] = 'busybox:latest'
kwargs['image'] = BUSYBOX_IMAGE_WITH_TAG
if 'command' not in kwargs:
kwargs['command'] = ["top"]

View File

@ -15,6 +15,7 @@ import pytest
import yaml
from ...helpers import build_config_details
from ...helpers import BUSYBOX_IMAGE_WITH_TAG
from compose.config import config
from compose.config import types
from compose.config.config import resolve_build_args
@ -343,7 +344,7 @@ class ConfigTest(unittest.TestCase):
with pytest.raises(ConfigurationError):
config.load(
build_config_details(
{'web': 'busybox:latest'},
{'web': BUSYBOX_IMAGE_WITH_TAG},
'working_dir',
'filename.yml'
)
@ -353,7 +354,7 @@ class ConfigTest(unittest.TestCase):
with pytest.raises(ConfigurationError):
config.load(
build_config_details(
{'version': '2', 'services': {'web': 'busybox:latest'}},
{'version': '2', 'services': {'web': BUSYBOX_IMAGE_WITH_TAG}},
'working_dir',
'filename.yml'
)
@ -364,7 +365,7 @@ class ConfigTest(unittest.TestCase):
config.load(
build_config_details({
'version': '2',
'services': {'web': 'busybox:latest'},
'services': {'web': BUSYBOX_IMAGE_WITH_TAG},
'networks': {
'invalid': {'foo', 'bar'}
}
@ -847,15 +848,15 @@ class ConfigTest(unittest.TestCase):
def test_load_sorts_in_dependency_order(self):
config_details = build_config_details({
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'links': ['db'],
},
'db': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': ['volume:ro']
},
'volume': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': ['/tmp'],
}
})
@ -1280,7 +1281,7 @@ class ConfigTest(unittest.TestCase):
'version': '2',
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': ['data0028:/data:ro'],
},
},
@ -1296,7 +1297,7 @@ class ConfigTest(unittest.TestCase):
'version': '2',
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': ['./data0028:/data:ro'],
},
},
@ -1312,7 +1313,7 @@ class ConfigTest(unittest.TestCase):
'base.yaml',
{
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': ['data0028:/data:ro'],
},
}
@ -1329,7 +1330,7 @@ class ConfigTest(unittest.TestCase):
'version': '2.3',
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': [
{
'target': '/anonymous', 'type': 'volume'
@ -1374,7 +1375,7 @@ class ConfigTest(unittest.TestCase):
'version': '3.4',
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': [
{'type': 'bind', 'source': './web', 'target': '/web'},
],
@ -1396,7 +1397,7 @@ class ConfigTest(unittest.TestCase):
'version': '3.4',
'services': {
'web': {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes': [
{'type': 'bind', 'source': '~/web', 'target': '/web'},
],
@ -2293,7 +2294,7 @@ class ConfigTest(unittest.TestCase):
def test_merge_mixed_ports(self):
base = {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'ports': [
{
@ -2310,7 +2311,7 @@ class ConfigTest(unittest.TestCase):
actual = config.merge_service_dicts(base, override, V3_1)
assert actual == {
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'command': 'top',
'ports': [types.ServicePort('1245', '1245', 'udp', None, None)]
}

View File

@ -5,6 +5,7 @@ import docker
from .. import mock
from .. import unittest
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from compose.const import LABEL_ONE_OFF
from compose.const import LABEL_SLUG
from compose.container import Container
@ -17,7 +18,7 @@ class ContainerTest(unittest.TestCase):
self.container_id = "abcabcabcbabc12345"
self.container_dict = {
"Id": self.container_id,
"Image": "busybox:latest",
"Image": BUSYBOX_IMAGE_WITH_TAG,
"Command": "top",
"Created": 1387384730,
"Status": "Up 8 seconds",
@ -43,7 +44,7 @@ class ContainerTest(unittest.TestCase):
has_been_inspected=True)
assert container.dictionary == {
"Id": self.container_id,
"Image": "busybox:latest",
"Image": BUSYBOX_IMAGE_WITH_TAG,
"Name": "/composetest_db_1",
}
@ -58,7 +59,7 @@ class ContainerTest(unittest.TestCase):
has_been_inspected=True)
assert container.dictionary == {
"Id": self.container_id,
"Image": "busybox:latest",
"Image": BUSYBOX_IMAGE_WITH_TAG,
"Name": "/composetest_db_1",
}

View File

@ -10,6 +10,7 @@ from docker.errors import NotFound
from .. import mock
from .. import unittest
from ..helpers import BUSYBOX_IMAGE_WITH_TAG
from compose.config.config import Config
from compose.config.types import VolumeFromSpec
from compose.const import COMPOSEFILE_V1 as V1
@ -39,11 +40,11 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
},
{
'name': 'db',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
},
],
networks=None,
@ -58,9 +59,9 @@ class ProjectTest(unittest.TestCase):
)
assert len(project.services) == 2
assert project.get_service('web').name == 'web'
assert project.get_service('web').options['image'] == 'busybox:latest'
assert project.get_service('web').options['image'] == BUSYBOX_IMAGE_WITH_TAG
assert project.get_service('db').name == 'db'
assert project.get_service('db').options['image'] == 'busybox:latest'
assert project.get_service('db').options['image'] == BUSYBOX_IMAGE_WITH_TAG
assert not project.networks.use_networking
@mock.patch('compose.network.Network.true_name', lambda n: n.full_name)
@ -70,11 +71,11 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
},
{
'name': 'db',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
},
],
networks=None,
@ -91,7 +92,7 @@ class ProjectTest(unittest.TestCase):
project='composetest',
name='web',
client=None,
image="busybox:latest",
image=BUSYBOX_IMAGE_WITH_TAG,
)
project = Project('test', [web], None)
assert project.get_service('web') == web
@ -176,7 +177,7 @@ class ProjectTest(unittest.TestCase):
version=V2_0,
services=[{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': [VolumeFromSpec('aaa', 'rw', 'container')]
}],
networks=None,
@ -194,7 +195,7 @@ class ProjectTest(unittest.TestCase):
"Name": container_name,
"Names": [container_name],
"Id": container_name,
"Image": 'busybox:latest'
"Image": BUSYBOX_IMAGE_WITH_TAG
}
]
project = Project.from_config(
@ -205,11 +206,11 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'vol',
'image': 'busybox:latest'
'image': BUSYBOX_IMAGE_WITH_TAG
},
{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': [VolumeFromSpec('vol', 'rw', 'service')]
}
],
@ -233,11 +234,11 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'vol',
'image': 'busybox:latest'
'image': BUSYBOX_IMAGE_WITH_TAG
},
{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'volumes_from': [VolumeFromSpec('vol', 'rw', 'service')]
}
],
@ -543,7 +544,7 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
}
],
networks=None,
@ -568,7 +569,7 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'network_mode': 'container:aaa'
},
],
@ -588,7 +589,7 @@ class ProjectTest(unittest.TestCase):
"Name": container_name,
"Names": [container_name],
"Id": container_name,
"Image": 'busybox:latest'
"Image": BUSYBOX_IMAGE_WITH_TAG
}
]
project = Project.from_config(
@ -599,11 +600,11 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'aaa',
'image': 'busybox:latest'
'image': BUSYBOX_IMAGE_WITH_TAG
},
{
'name': 'test',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'network_mode': 'service:aaa'
},
],
@ -626,7 +627,7 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'foo',
'image': 'busybox:latest'
'image': BUSYBOX_IMAGE_WITH_TAG
},
],
networks=None,
@ -647,7 +648,7 @@ class ProjectTest(unittest.TestCase):
services=[
{
'name': 'foo',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
'networks': {'custom': None}
},
],
@ -662,9 +663,9 @@ class ProjectTest(unittest.TestCase):
def test_container_without_name(self):
self.mock_client.containers.return_value = [
{'Image': 'busybox:latest', 'Id': '1', 'Name': '1'},
{'Image': 'busybox:latest', 'Id': '2', 'Name': None},
{'Image': 'busybox:latest', 'Id': '3'},
{'Image': BUSYBOX_IMAGE_WITH_TAG, 'Id': '1', 'Name': '1'},
{'Image': BUSYBOX_IMAGE_WITH_TAG, 'Id': '2', 'Name': None},
{'Image': BUSYBOX_IMAGE_WITH_TAG, 'Id': '3'},
]
self.mock_client.inspect_container.return_value = {
'Id': '1',
@ -681,7 +682,7 @@ class ProjectTest(unittest.TestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
}],
networks=None,
volumes=None,
@ -699,7 +700,7 @@ class ProjectTest(unittest.TestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
}],
networks={'default': {}},
volumes={'data': {}},
@ -711,7 +712,7 @@ class ProjectTest(unittest.TestCase):
self.mock_client.remove_volume.side_effect = NotFound(None, None, 'oops')
project.down(ImageType.all, True)
self.mock_client.remove_image.assert_called_once_with("busybox:latest")
self.mock_client.remove_image.assert_called_once_with(BUSYBOX_IMAGE_WITH_TAG)
def test_no_warning_on_stop(self):
self.mock_client.info.return_value = {'Swarm': {'LocalNodeState': 'active'}}
@ -744,7 +745,7 @@ class ProjectTest(unittest.TestCase):
def test_project_platform_value(self):
service_config = {
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
}
config_data = Config(
version=V2_4, services=[service_config], networks={}, volumes={}, secrets=None, configs=None
@ -771,8 +772,8 @@ class ProjectTest(unittest.TestCase):
config_data = Config(
version=V3_7,
services=[
{'name': 'web', 'image': 'busybox:latest'},
{'name': 'db', 'image': 'busybox:latest', 'stop_grace_period': '1s'},
{'name': 'web', 'image': BUSYBOX_IMAGE_WITH_TAG},
{'name': 'db', 'image': BUSYBOX_IMAGE_WITH_TAG, 'stop_grace_period': '1s'},
],
networks={}, volumes={}, secrets=None, configs=None,
)
@ -804,7 +805,7 @@ class ProjectTest(unittest.TestCase):
version=V2_0,
services=[{
'name': 'web',
'image': 'busybox:latest',
'image': BUSYBOX_IMAGE_WITH_TAG,
}],
networks=None,
volumes=None,

View File

@ -828,7 +828,7 @@ class ServiceTest(unittest.TestCase):
assert service.specifies_host_port()
def test_image_name_from_config(self):
image_name = 'example/web:latest'
image_name = 'example/web:mytag'
service = Service('foo', image=image_name)
assert service.image_name == image_name