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

Incorrectly reports that docker is not found on docker-container error #785

Open
3 tasks done
jfgordon2 opened this issue Aug 21, 2023 · 1 comment
Open
3 tasks done

Comments

@jfgordon2
Copy link
Contributor

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you using the latest plugin release?

  • Yes, I'm using the latest plugin release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

Currently, if an error is raised within a docker container (such as missing python bin), then the error raised to the user is docker not found! Please install it even if it exists. Found by referencing a python3.9 image while using serverless file configured for python3.8.

This error is misleading, as it leads a developer to investigate getting the docker CLI onto their path within their development environment, rather than correctly investigating the issue within the container.

Service configuration (serverless.yml) content

service: aws-python-rest-api

frameworkVersion: '3'

plugins:
  - serverless-python-requirements

custom:
  pythonRequirements:
    usePipenv: true
    usePoetry: false
    dockerImage: public.ecr.aws/sam/build-python3.9:latest-x86_64
    dockerizePip: true

provider:
  name: aws
  runtime: python3.8

functions:
  hello:
    handler: handler.hello
    events:
      - http:
          path: /
          method: get

Command name and used flags

serverless package

Command output

Run serverless package --verbose

Packaging aws-python-rest-api for stage dev (us-east-1)

Generating requirements.txt from Pipfile
Parsed requirements.txt from Pipfile in /home/runner/work/example/example/.serverless/requirements.txt
Installing requirements from "/home/runner/.cache/serverless-python-requirements/487616df2faf4e5d7376ec4f48b2975119acdddd9b98f821e416bc7e8e11d57f_x86_64_slspyc/requirements.txt"
Docker Image: public.ecr.aws/sam/build-python3.9:latest-x86_64
Using download cache directory /home/runner/.cache/serverless-python-requirements/downloadCacheslspyc
Running docker run --rm -v /home/runner/.cache/serverless-python-requirements/487616df2faf4e5d7376ec4f48b2975119acdddd9b98f821e416bc7e8e11d57f_x86_64_slspyc\:/var/task\:z -v /home/runner/.cache/serverless-python-requirements/downloadCacheslspyc\:/var/useDownloadCache\:z public.ecr.aws/sam/build-python3.9\:latest-x86_64 /bin/sh -c 'chown -R 0\\:0 /var/useDownloadCache && python3.8 -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache && chown -R 1000\\:1000 /var/task && chown -R 1000\\:1000 /var/useDownloadCache && find /var/task -name \\*.so -exec strip \\{\\} \\;'...
Environment: linux, node 20.5.1, framework 3.33.0 (local), plugin 6.2.3, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Error:
docker not found! Please install it
Bugs:        github.com/serverless/serverless/issues

Environment information

Framework Core: 3.33.0 (local)
Plugin: 6.2.3
SDK: 4.3.2
@douglasmoraisdev
Copy link

I have exactly the same error using Ubuntu and MacOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants