Skip to content

Instantly share code, notes, and snippets.

@rpivo
Last active February 15, 2021 16:41
Show Gist options
  • Save rpivo/b7538a6ae13d66f779fcbf44dba8d1f8 to your computer and use it in GitHub Desktop.
Save rpivo/b7538a6ae13d66f779fcbf44dba8d1f8 to your computer and use it in GitHub Desktop.
Manually Starting an Amazon Linux Docker Container and Preparing Python Packages for AWS Lambda

Manually Starting an Amazon Linux Docker Container and Preparing Python Packages for AWS Lambda

You can start an interactive shell with an amazonlinux Docker container with this command:

docker run -it -v ~/Documents/dev/folder:/virtual-folder amazonlinux

See this gist for more details on the above.

Inside the shell, update the internals.

yum update -y

Then, install dependencies.

yum install -y gcc gcc72-c++ gzip libxml2-dev libxslt-dev make python-pip tar wget

Use the already-available amazon-linux-extras to install the latest version of Python.

amazon-linux-extras install -y python3.8

You can verify that Python was installed.

python3.8 -V

Then, install pip3.

python3.8 -m pip install -U pip

Then, install your dependencies (pytrends, in this case), and set the target to a folder called package within the bind-mount location.

pip3 install pytrends --target ./bind-mount/package

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment