Skip to content

Instantly share code, notes, and snippets.

@lgvital
Created August 12, 2019 07:13
Show Gist options
  • Save lgvital/9fa8a07fcbc4af532e0470a799493da7 to your computer and use it in GitHub Desktop.
Save lgvital/9fa8a07fcbc4af532e0470a799493da7 to your computer and use it in GitHub Desktop.
docker-compose conversion error
lionel@machine:~/code/cookiecutter_aws (master)$ python convert-docker-compose-to-aws.py
DOCKERHUB_USER=lionelv
Input file: production.yml
Output file: production.yml
redis uses an image, skipping
Building postgres
Step 1/4 : FROM postgres:11.3
---> 4e045cb8eecd
Step 2/4 : COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance
---> Using cache
---> 93150de3a9cc
Step 3/4 : RUN chmod +x /usr/local/bin/maintenance/*
---> Using cache
---> 7c75bd3de45e
Step 4/4 : RUN mv /usr/local/bin/maintenance/* /usr/local/bin && rmdir /usr/local/bin/maintenance
---> Using cache
---> 6e7bde13e3ef
Successfully built 6e7bde13e3ef
Successfully tagged cookiecutter_aws_production_postgres:latest
Building django
Step 1/19 : FROM python:3.6-alpine
---> 2068eb9e7f62
Step 2/19 : ENV PYTHONUNBUFFERED 1
---> Using cache
---> 7a95a3bced06
Step 3/19 : RUN apk update && apk add --virtual build-deps gcc python3-dev musl-dev && apk add postgresql-dev && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev && apk add libffi-dev py-cffi
---> Using cache
---> 92b76d2e9f42
Step 4/19 : RUN addgroup -S django && adduser -S -G django django
---> Using cache
---> 1027c5bf9232
Step 5/19 : COPY ./requirements /requirements
---> 4ce92764925b
Step 6/19 : RUN pip install --no-cache-dir -r /requirements/production.txt && rm -rf /requirements
---> Running in cd06f8f7f283
Collecting pytz==2019.2 (from -r /requirements/./base.txt (line 1))
Downloading https://files.pythonhosted.org/packages/87/76/46d697698a143e05f77bec5a526bf4e56a0be61d63425b68f4ba553b51f2/pytz-2019.2-py2.py3-none-any.whl (508kB)
Collecting python-slugify==3.0.3 (from -r /requirements/./base.txt (line 2))
Downloading https://files.pythonhosted.org/packages/a2/5d/bd30413c00bbed3945558aca07c55944073e1e30abeee1f06515281f9811/python-slugify-3.0.3.tar.gz
Collecting Pillow==6.1.0 (from -r /requirements/./base.txt (line 3))
Downloading https://files.pythonhosted.org/packages/51/fe/18125dc680720e4c3086dd3f5f95d80057c41ab98326877fc7d3ff6d0ee5/Pillow-6.1.0.tar.gz (33.8MB)
Collecting argon2-cffi==19.1.0 (from -r /requirements/./base.txt (line 4))
Downloading https://files.pythonhosted.org/packages/aa/bb/d620acb83d6e7d0a1f896557524b85e058500bd858ee814d467428718811/argon2_cffi-19.1.0.tar.gz (1.8MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Collecting whitenoise==4.1.3 (from -r /requirements/./base.txt (line 5))
Downloading https://files.pythonhosted.org/packages/96/75/92afb2d8912ac19646f67a2c69bb8683e5aab78db3b0791bfd3e7ed022bb/whitenoise-4.1.3-py2.py3-none-any.whl
Collecting redis==3.3.6 (from -r /requirements/./base.txt (line 6))
Downloading https://files.pythonhosted.org/packages/5c/2a/626d8e420d4a8737c933717b615d63cc42f48553d5dc41ec60984c3d26d7/redis-3.3.6-py2.py3-none-any.whl (65kB)
Collecting django==2.2.4 (from -r /requirements/./base.txt (line 10))
Downloading https://files.pythonhosted.org/packages/d6/57/66997ca6ef17d2d0f0ebcd860bc6778095ffee04077ca8985928175da358/Django-2.2.4-py3-none-any.whl (7.5MB)
Collecting django-environ==0.4.5 (from -r /requirements/./base.txt (line 11))
Downloading https://files.pythonhosted.org/packages/9f/32/76295a1a5d00bf556c495216581c6997e7fa5f533b2229e0a9d6cbaa95ae/django_environ-0.4.5-py2.py3-none-any.whl
Collecting django-model-utils==3.2.0 (from -r /requirements/./base.txt (line 12))
Downloading https://files.pythonhosted.org/packages/7e/ed/c8d4654bce5859766c989ca0cc3dc439d3abd00f5b1c6ef4d80b0a5f2871/django_model_utils-3.2.0-py2.py3-none-any.whl
Collecting django-allauth==0.39.1 (from -r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/9c/dc/b7821e2b62311e402c24749f32dcbc337501f1d87e4eb2d4ef19e1e95f31/django-allauth-0.39.1.tar.gz (534kB)
Collecting django-crispy-forms==1.7.2 (from -r /requirements/./base.txt (line 14))
Downloading https://files.pythonhosted.org/packages/9a/05/6bad05742d185ec2fabfa4deab05cafde286eb3f383fba24b3674340aca2/django_crispy_forms-1.7.2-py2.py3-none-any.whl (105kB)
Collecting django-redis==4.10.0 (from -r /requirements/./base.txt (line 15))
Downloading https://files.pythonhosted.org/packages/f8/79/1fd48c585d5a95fd314571ac34c13f6bc1f7e65cbb5ed9ac0299212f35ce/django_redis-4.10.0-py2.py3-none-any.whl
Collecting djangorestframework==3.10.2 (from -r /requirements/./base.txt (line 18))
Downloading https://files.pythonhosted.org/packages/af/2a/055e65e1aa25cc2726d68d78b859a7b5955c673bc5e4646b205c21e05b25/djangorestframework-3.10.2-py3-none-any.whl (908kB)
Collecting coreapi==2.3.3 (from -r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/fc/3a/9dedaad22962770edd334222f2b3c3e7ad5e1c8cab1d6a7992c30329e2e5/coreapi-2.3.3-py2.py3-none-any.whl
Collecting gunicorn==19.9.0 (from -r /requirements/production.txt (line 5))
Downloading https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl (112kB)
Collecting psycopg2==2.8.3 (from -r /requirements/production.txt (line 6))
Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)
Collecting django-storages[boto3]==1.7.1 (from -r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/a0/00/b15822dbc3ea8ea3b80dca394fafc758f5ced6bf4aa357f636f43e08de8d/django_storages-1.7.1-py2.py3-none-any.whl (44kB)
Collecting django-anymail[mailgun]==6.1.0 (from -r /requirements/production.txt (line 11))
Downloading https://files.pythonhosted.org/packages/bb/04/5e757f9f803cfac3e9480a59fab4dda00233299d651028e72bf06086265b/django_anymail-6.1.0-py2.py3-none-any.whl (96kB)
Collecting text-unidecode==1.2 (from python-slugify==3.0.3->-r /requirements/./base.txt (line 2))
Downloading https://files.pythonhosted.org/packages/79/42/d717cc2b4520fb09e45b344b1b0b4e81aa672001dd128c180fabc655c341/text_unidecode-1.2-py2.py3-none-any.whl (77kB)
Collecting cffi>=1.0.0 (from argon2-cffi==19.1.0->-r /requirements/./base.txt (line 4))
Downloading https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz (456kB)
Collecting six (from argon2-cffi==19.1.0->-r /requirements/./base.txt (line 4))
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting sqlparse (from django==2.2.4->-r /requirements/./base.txt (line 10))
Downloading https://files.pythonhosted.org/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
Collecting python3-openid>=3.0.8 (from django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/bd/de/52c5699f52dcee3037db587196dcaf63ffedf5fbeba3183afe9b21a3a89f/python3_openid-3.1.0-py3-none-any.whl (130kB)
Collecting requests-oauthlib>=0.3.0 (from django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/c2/e2/9fd03d55ffb70fe51f587f20bcf407a6927eb121de86928b34d162f0b1ac/requests_oauthlib-1.2.0-py2.py3-none-any.whl
Collecting requests (from django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
Collecting itypes (from coreapi==2.3.3->-r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/d3/24/5e511590f95582efe64b8ad2f6dadd85c5563c9dcf40171ea5a70adbf5a9/itypes-1.1.0.tar.gz
Collecting coreschema (from coreapi==2.3.3->-r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/93/08/1d105a70104e078718421e6c555b8b293259e7fc92f7e9a04869947f198f/coreschema-0.0.4.tar.gz
Collecting uritemplate (from coreapi==2.3.3->-r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/e5/7d/9d5a640c4f8bf2c8b1afc015e9a9d8de32e13c9016dcc4b0ec03481fb396/uritemplate-3.0.0-py2.py3-none-any.whl
Collecting boto3>=1.4.4; extra == "boto3" (from django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/49/d1/93d50a60b299df9ab1ae6b6fa683c5d3166b5b14e05d9660071d604bbd39/boto3-1.9.205-py2.py3-none-any.whl (128kB)
Collecting pycparser (from cffi>=1.0.0->argon2-cffi==19.1.0->-r /requirements/./base.txt (line 4))
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
Collecting defusedxml (from python3-openid>=3.0.8->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.3.0->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
Collecting idna<2.9,>=2.5 (from requests->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl (150kB)
Collecting certifi>=2017.4.17 (from requests->django-allauth==0.39.1->-r /requirements/./base.txt (line 13))
Downloading https://files.pythonhosted.org/packages/69/1b/b853c7a9d4f6a6d00749e94eb6f3a041e342a885b87340b79c1ef73e3a78/certifi-2019.6.16-py2.py3-none-any.whl (157kB)
Collecting jinja2 (from coreschema->coreapi==2.3.3->-r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
Collecting botocore<1.13.0,>=1.12.205 (from boto3>=1.4.4; extra == "boto3"->django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/f8/54/3e3df6187a61456d9efaf0f4151b5e2d5bcf60e3a80de723d32ce7be1df2/botocore-1.12.205-py2.py3-none-any.whl (5.7MB)
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3>=1.4.4; extra == "boto3"->django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl (70kB)
Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.4.4; extra == "boto3"->django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2->coreschema->coreapi==2.3.3->-r /requirements/./base.txt (line 19))
Downloading https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore<1.13.0,>=1.12.205->boto3>=1.4.4; extra == "boto3"->django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
Collecting docutils<0.15,>=0.10 (from botocore<1.13.0,>=1.12.205->boto3>=1.4.4; extra == "boto3"->django-storages[boto3]==1.7.1->-r /requirements/production.txt (line 10))
Downloading https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
Installing collected packages: pytz, text-unidecode, python-slugify, Pillow, pycparser, cffi, six, argon2-cffi, whitenoise, redis, sqlparse, django, django-environ, django-model-utils, defusedxml, python3-openid, idna, chardet, urllib3, certifi, requests, oauthlib, requests-oauthlib, django-allauth, django-crispy-forms, django-redis, djangorestframework, itypes, MarkupSafe, jinja2, coreschema, uritemplate, coreapi, gunicorn, psycopg2, python-dateutil, jmespath, docutils, botocore, s3transfer, boto3, django-storages, django-anymail
Running setup.py install for python-slugify: started
Running setup.py install for python-slugify: finished with status 'done'
Running setup.py install for Pillow: started
Running setup.py install for Pillow: still running...
Running setup.py install for Pillow: finished with status 'done'
Running setup.py install for pycparser: started
Running setup.py install for pycparser: finished with status 'done'
Running setup.py install for cffi: started
Running setup.py install for cffi: finished with status 'done'
Running setup.py install for argon2-cffi: started
Running setup.py install for argon2-cffi: finished with status 'done'
Running setup.py install for django-allauth: started
Running setup.py install for django-allauth: finished with status 'done'
Running setup.py install for itypes: started
Running setup.py install for itypes: finished with status 'done'
Running setup.py install for MarkupSafe: started
Running setup.py install for MarkupSafe: finished with status 'done'
Running setup.py install for coreschema: started
Running setup.py install for coreschema: finished with status 'done'
Running setup.py install for psycopg2: started
Running setup.py install for psycopg2: finished with status 'done'
Successfully installed MarkupSafe-1.1.1 Pillow-6.1.0 argon2-cffi-19.1.0 boto3-1.9.205 botocore-1.12.205 certifi-2019.6.16 cffi-1.12.3 chardet-3.0.4 coreapi-2.3.3 coreschema-0.0.4 defusedxml-0.6.0 django-2.2.4 django-allauth-0.39.1 django-anymail-6.1.0 django-crispy-forms-1.7.2 django-environ-0.4.5 django-model-utils-3.2.0 django-redis-4.10.0 django-storages-1.7.1 djangorestframework-3.10.2 docutils-0.14 gunicorn-19.9.0 idna-2.8 itypes-1.1.0 jinja2-2.10.1 jmespath-0.9.4 oauthlib-3.1.0 psycopg2-2.8.3 pycparser-2.19 python-dateutil-2.8.0 python-slugify-3.0.3 python3-openid-3.1.0 pytz-2019.2 redis-3.3.6 requests-2.22.0 requests-oauthlib-1.2.0 s3transfer-0.2.1 six-1.12.0 sqlparse-0.3.0 text-unidecode-1.2 uritemplate-3.0.0 urllib3-1.25.3 whitenoise-4.1.3
You are using pip version 10.0.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Removing intermediate container cd06f8f7f283
---> 2d47afa1cd02
Step 7/19 : COPY ./compose/production/django/entrypoint /entrypoint
---> db1425502e32
Step 8/19 : RUN sed -i 's/\r$//g' /entrypoint
---> Running in 7713586a2032
Removing intermediate container 7713586a2032
---> 2f182b4757f5
Step 9/19 : RUN chmod +x /entrypoint
---> Running in f1773e48d783
Removing intermediate container f1773e48d783
---> 770360ecbcd1
Step 10/19 : RUN chown django /entrypoint
---> Running in a1c0b7e38713
Removing intermediate container a1c0b7e38713
---> 10c025e0d3b0
Step 11/19 : COPY ./compose/production/django/start /start
---> 9e5b8e35967a
Step 12/19 : RUN sed -i 's/\r$//g' /start
---> Running in 7d1978d8a389
Removing intermediate container 7d1978d8a389
---> 7f7745e9c631
Step 13/19 : RUN chmod +x /start
---> Running in bffd87e83e77
Removing intermediate container bffd87e83e77
---> 380e1de0c6e2
Step 14/19 : RUN chown django /start
---> Running in d57adea9e3d5
Removing intermediate container d57adea9e3d5
---> 089e7654062a
Step 15/19 : COPY . /app
---> d059f1f492ca
Step 16/19 : RUN chown -R django /app
---> Running in 0f5a96f3b1c1
Removing intermediate container 0f5a96f3b1c1
---> e2477a42a7af
Step 17/19 : USER django
---> Running in 6af5586b4dae
Removing intermediate container 6af5586b4dae
---> ce757ad81bb0
Step 18/19 : WORKDIR /app
---> Running in 0505420181a5
Removing intermediate container 0505420181a5
---> 1b4759e342b2
Step 19/19 : ENTRYPOINT ["/entrypoint"]
---> Running in 1199c26b88c5
Removing intermediate container 1199c26b88c5
---> 72f1b0e70c19
Successfully built 72f1b0e70c19
Successfully tagged cookiecutter_aws_production_django:latest
Building traefik
Step 1/5 : FROM traefik:alpine
---> 11f1b77e546a
Step 2/5 : RUN mkdir -p /etc/traefik/acme
---> Using cache
---> 389a72e6997b
Step 3/5 : RUN touch /etc/traefik/acme/acme.json
---> Using cache
---> 42d85733deb5
Step 4/5 : RUN chmod 600 /etc/traefik/acme/acme.json
---> Using cache
---> 2d37ab017051
Step 5/5 : COPY ./compose/production/traefik/traefik.toml /etc/traefik
---> 2e9938b62a15
Successfully built 2e9938b62a15
Successfully tagged cookiecutter_aws_production_traefik:latest
Building awscli
Step 1/5 : FROM garland/aws-cli-docker:1.15.47
---> 8f85f62e7b19
Step 2/5 : COPY ./compose/production/aws/maintenance /usr/local/bin/maintenance
---> 19ddae3916b6
Step 3/5 : COPY ./compose/production/postgres/maintenance/_sourced /usr/local/bin/maintenance/_sourced
---> 2e54a9afb39c
Step 4/5 : RUN chmod +x /usr/local/bin/maintenance/*
---> Running in b479d60286ab
Removing intermediate container b479d60286ab
---> e6b41ddb2f66
Step 5/5 : RUN mv /usr/local/bin/maintenance/* /usr/local/bin && rmdir /usr/local/bin/maintenance
---> Running in 08e34fde6647
Removing intermediate container 08e34fde6647
---> 47b9fc5734a2
Successfully built 47b9fc5734a2
Successfully tagged cookiecutter_aws_awscli:latest
Error response from daemon: No such image: cookiecutter_aws_django:latest
Traceback (most recent call last):
File "convert-docker-compose-to-aws.py", line 56, in <module>
subprocess.check_call(["docker", "tag", compose_image, hub_image])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'tag', 'cookiecutter_aws_django', 'lionelv/cookiecutter_aws_django:1565593376']' returned non-zero exit status 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment