aws-elastic-beanstalk-cli icon indicating copy to clipboard operation
aws-elastic-beanstalk-cli copied to clipboard

Official docker image

Open ondrados opened this issue 2 years ago • 2 comments

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Tell us about your request

Can you please make official docker image just like amazon/aws-cli?

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

I would like to use this for my deploy pipeline in github actions / gitlab CI

How are you currently solving this problem?

I am building my own docker image with installing lot of dependencies to make instalation work

ondrados avatar Apr 23 '22 11:04 ondrados

Oh, same here! Today I started deploying my multi-container app to Elastic Beanstalk via GitLab CI and was so confused... At first, I tried to use it from aws-cli which seemed quite logical to me, because I used ECS and ECR services from aws-cli before but then I saw an error and was like "Wha-?". Then realized it was totally different CLI for some reason and not included in aws-cli and started searching for its Docker image, resultless. And now I'm finally here. Would love to see an official docker image of Elastic Beanstalk CLI! ❤️

Also @ondrados, any progress on your own image? Would love to see and use it!

PAXANDDOS avatar May 12 '22 15:05 PAXANDDOS

I managed to create pretty simple docker image based on amazon/aws-cli, see ondrados/aws-eb-cli

FROM amazon/aws-cli:latest

ENV PATH="/root/.local/bin:${PATH}"

RUN yum install python37 -y \
    && pip3 install awsebcli

ENTRYPOINT []

ondrados avatar May 12 '22 15:05 ondrados

With the Dockerfile from https://github.com/aws/aws-elastic-beanstalk-cli/issues/108#issuecomment-1125167013, I have recently (within the last 10 days or so) starting getting this error after building the image and then trying to run any eb command within a container:

Traceback (most recent call last):
  File "/usr/local/bin/eb", line 33, in <module>
    sys.exit(load_entry_point('awsebcli==3.20.6', 'console_scripts', 'eb')())
  File "/usr/local/bin/eb", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 210, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/ebcli/core/ebcore.py", line 19, in <module>
    from ebcli.core import ebglobals, base, hooks
  File "/usr/local/lib/python3.7/site-packages/ebcli/core/base.py", line 21, in <module>
    from ebcli.core import io
  File "/usr/local/lib/python3.7/site-packages/ebcli/core/io.py", line 22, in <module>
    from botocore.compat import six
  File "/usr/local/lib/python3.7/site-packages/botocore/compat.py", line 32, in <module>
    from urllib3 import exceptions
  File "/usr/local/lib/python3.7/site-packages/urllib3/__init__.py", line 39, in <module>
    "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips  26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168

I don't know what has changed to cause this. I tried going back a few versions of the aws-cli image (to a month-old one or so) but had same problem. I don't think it's that, since I have built and used an image successfully about 10 days ago.

jkburges avatar Apr 27 '23 05:04 jkburges

FWIW, the following works (using a more recent python version, but aws cli won't be there for those who need it):

FROM python:latest

RUN pip3 install awsebcli

COPY . /app
WORKDIR /app

ENTRYPOINT []

jkburges avatar Apr 27 '23 06:04 jkburges

FROM python:3.10-bookworm as Builder
RUN pip install --no-cache-dir --no-cache virtualenv
WORKDIR /awsebcli
RUN virtualenv --python=$(which python3) /opt/env
ENV PATH="/opt/env/bin:$PATH"
RUN pip install --no-cache-dir --no-cache awsebcli==3.20.10
FROM python:3.10-slim-bookworm
WORKDIR /awsebcli
COPY --from=Builder /opt/env /opt/env
ENV PATH="/opt/env/bin:$PATH"
ENV PYTHONUNBUFFERED=1
ENTRYPOINT [ "eb" ]

This is the docker image for AWSEBCLI v3.20.10 , to run it , paste it in a Dockerfile and run it with the --no-cache flag . Modify line 6 to any other version if you prefer it .

NihalM99 avatar Oct 12 '23 02:10 NihalM99