File tree Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Pull the Amazon Linux image from Docker Hub
4+ docker pull amazonlinux
5+
6+ # Run the Amazon Linux container in detached mode
7+ docker run -d --name telemetry amazonlinux tail -f /dev/null
8+
9+ # Install Python, pip, and other dependencies inside the container
10+ docker exec -it telemetry /bin/bash -c " yum update -y && yum install -y python3-pip zip && python3 -m pip install virtualenv"
11+
12+ # Create a virtual environment and install dependencies
13+ docker exec -it telemetry /bin/bash -c " python3 -m venv temp-venv && source temp-venv/bin/activate && mkdir telemetry && cd telemetry && pip install crhelper sumologic-appclient-sdk future_fstrings setuptools -t ."
14+
15+ # Copy python file from host to container
16+ docker cp ./lambda_function.py telemetry:/telemetry
17+
18+ # Zip the contents of the telemetry directory
19+ docker exec -it telemetry /bin/bash -c " cd telemetry && ls -l && zip -r ../telemetry.zip ."
20+
21+ # Copy the telemetry.zip file from the container to the host
22+ docker cp telemetry:/telemetry.zip ./telemetry.zip
23+
24+ # Stop and remove the container
25+ docker stop telemetry
26+ docker rm telemetry
You can’t perform that action at this time.
0 commit comments