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

Image - Check multiplatform build support against docker version #55

Merged
merged 9 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand All @@ -29,10 +29,10 @@ jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand All @@ -45,10 +45,10 @@ jobs:
integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand Down
12 changes: 12 additions & 0 deletions manof/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pipes
import inspect
import re
import semver

from twisted.internet import defer

Expand Down Expand Up @@ -861,6 +862,17 @@ def _disconnect_container_from_network(self, container_name, network):
@defer.inlineCallbacks
def _daemon_supports_multiplatform_build(self):

# multiplatform build is not experimental from 20.10.21
out, _, _ = yield self._run_command(
'docker version --format \'{{.Client.Version}}\''
)
try:
if out and semver.Version.parse(out) >= semver.Version.parse('20.10.21'):
defer.returnValue(True)

except ValueError:
pass

# There are 2 lines with the key Experimental - one for the server and one for the client.
# They both need to be true for the multiplatform build to be supported
out, _, _ = yield self._run_command('docker version | grep Experimental')
Expand Down
1 change: 1 addition & 0 deletions requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ colorama==0.4.5
pygments==2.13.0
ruamel.yaml==0.17.21
setuptools==67.3.3
semver==3.0.0