const.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. from __future__ import absolute_import
  2. from __future__ import unicode_literals
  3. import sys
  4. from .version import ComposeVersion
  5. DEFAULT_TIMEOUT = 10
  6. HTTP_TIMEOUT = 60
  7. IMAGE_EVENTS = ['delete', 'import', 'load', 'pull', 'push', 'save', 'tag', 'untag']
  8. IS_WINDOWS_PLATFORM = (sys.platform == "win32")
  9. LABEL_CONTAINER_NUMBER = 'com.docker.compose.container-number'
  10. LABEL_ONE_OFF = 'com.docker.compose.oneoff'
  11. LABEL_PROJECT = 'com.docker.compose.project'
  12. LABEL_SERVICE = 'com.docker.compose.service'
  13. LABEL_NETWORK = 'com.docker.compose.network'
  14. LABEL_VERSION = 'com.docker.compose.version'
  15. LABEL_VOLUME = 'com.docker.compose.volume'
  16. LABEL_CONFIG_HASH = 'com.docker.compose.config-hash'
  17. NANOCPUS_SCALE = 1000000000
  18. PARALLEL_LIMIT = 64
  19. SECRETS_PATH = '/run/secrets'
  20. COMPOSEFILE_V1 = ComposeVersion('1')
  21. COMPOSEFILE_V2_0 = ComposeVersion('2.0')
  22. COMPOSEFILE_V2_1 = ComposeVersion('2.1')
  23. COMPOSEFILE_V2_2 = ComposeVersion('2.2')
  24. COMPOSEFILE_V2_3 = ComposeVersion('2.3')
  25. COMPOSEFILE_V3_0 = ComposeVersion('3.0')
  26. COMPOSEFILE_V3_1 = ComposeVersion('3.1')
  27. COMPOSEFILE_V3_2 = ComposeVersion('3.2')
  28. COMPOSEFILE_V3_3 = ComposeVersion('3.3')
  29. COMPOSEFILE_V3_4 = ComposeVersion('3.4')
  30. COMPOSEFILE_V3_5 = ComposeVersion('3.5')
  31. COMPOSEFILE_V3_6 = ComposeVersion('3.6')
  32. API_VERSIONS = {
  33. COMPOSEFILE_V1: '1.21',
  34. COMPOSEFILE_V2_0: '1.22',
  35. COMPOSEFILE_V2_1: '1.24',
  36. COMPOSEFILE_V2_2: '1.25',
  37. COMPOSEFILE_V2_3: '1.30',
  38. COMPOSEFILE_V3_0: '1.25',
  39. COMPOSEFILE_V3_1: '1.25',
  40. COMPOSEFILE_V3_2: '1.25',
  41. COMPOSEFILE_V3_3: '1.30',
  42. COMPOSEFILE_V3_4: '1.30',
  43. COMPOSEFILE_V3_5: '1.30',
  44. COMPOSEFILE_V3_6: '1.36',
  45. }
  46. API_VERSION_TO_ENGINE_VERSION = {
  47. API_VERSIONS[COMPOSEFILE_V1]: '1.9.0',
  48. API_VERSIONS[COMPOSEFILE_V2_0]: '1.10.0',
  49. API_VERSIONS[COMPOSEFILE_V2_1]: '1.12.0',
  50. API_VERSIONS[COMPOSEFILE_V2_2]: '1.13.0',
  51. API_VERSIONS[COMPOSEFILE_V2_3]: '17.06.0',
  52. API_VERSIONS[COMPOSEFILE_V3_0]: '1.13.0',
  53. API_VERSIONS[COMPOSEFILE_V3_1]: '1.13.0',
  54. API_VERSIONS[COMPOSEFILE_V3_2]: '1.13.0',
  55. API_VERSIONS[COMPOSEFILE_V3_3]: '17.06.0',
  56. API_VERSIONS[COMPOSEFILE_V3_4]: '17.06.0',
  57. API_VERSIONS[COMPOSEFILE_V3_5]: '17.06.0',
  58. API_VERSIONS[COMPOSEFILE_V3_6]: '18.02.0',
  59. }