Skip to content

Commit 195bf5e

Browse files
authored
debug-init images: add support for non-root user mode (#980)
* debug-init images: add support non-root user mode * README: add jq as a pre-req to running integ tests
1 parent 9583452 commit 195bf5e

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ so AWS credentials must be setup before they are run.
460460

461461
Instructions:
462462
1. Setup AWS access via EC2 instance role or AWS_* env vars
463-
2. Install dependent packages: `docker awscli`
463+
2. Install dependent packages: `docker awscli jq`
464464
3. Install docker-compose:
465465
```
466466
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

scripts/dockerfiles/runtime/Dockerfile.init-debug

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ CMD echo "AWS for Fluent Bit Container Image Version `cat /AWS_FOR_FLUENT_BIT_VE
99
if [ "$S3_KEY_PREFIX" == "issue" ]; then \
1010
echo "Note: Please set S3_KEY_PREFIX environment variable to a useful identifier - e.g. company name, team name, customer name"; \
1111
fi; \
12-
/init/fluent_bit_init_process; \
13-
chmod +x /init/invoke_fluent_bit.sh; \
1412
export RUN_ID=$(($RANDOM%99999))$(($RANDOM%99999))$(($RANDOM%99999)); \
1513
echo "RUN_ID is set to $RUN_ID"; \
16-
env RUN_ID=$RUN_ID /init/invoke_fluent_bit.sh; \
14+
/init/fluent_bit_init_process; \
15+
# Source the invoke script from the appropriate location
16+
if [ -f /init/invoke_fluent_bit.sh ]; then \
17+
chmod +x /init/invoke_fluent_bit.sh; \
18+
env RUN_ID=$RUN_ID /init/invoke_fluent_bit.sh; \
19+
elif [ -f /tmp/init/invoke_fluent_bit.sh ]; then \
20+
chmod +x /tmp/init/invoke_fluent_bit.sh; \
21+
env RUN_ID=$RUN_ID /tmp/init/invoke_fluent_bit.sh; \
22+
else \
23+
echo "Error: invoke_fluent_bit.sh not found in /init or /tmp/init"; \
24+
exit 1; \
25+
fi; \
1726
/core_uploader.sh $S3_BUCKET $S3_KEY_PREFIX $RUN_ID

scripts/dockerfiles/runtime/Dockerfile.init-debug-efs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@ ARG RUNTIME_IMAGE
22
FROM ${RUNTIME_IMAGE}
33

44
# Only last CMD command will be executed, automatically replaces the original entrypoint
5-
CMD /init/fluent_bit_init_process; chmod +x /init/invoke_fluent_bit.sh; cd /cores; /init/invoke_fluent_bit.sh; echo "Waiting 2 minutes for EFS core file transfers"; sleep 120
5+
CMD /init/fluent_bit_init_process; \
6+
# Source the invoke script from the appropriate location
7+
if [ -f /init/invoke_fluent_bit.sh ]; then \
8+
chmod +x /init/invoke_fluent_bit.sh; \
9+
cd /cores; /init/invoke_fluent_bit.sh; \
10+
elif [ -f /tmp/init/invoke_fluent_bit.sh ]; then \
11+
chmod +x /tmp/init/invoke_fluent_bit.sh; \
12+
cd /cores; /tmp/init/invoke_fluent_bit.sh; \
13+
else \
14+
echo "Error: invoke_fluent_bit.sh not found in /init or /tmp/init"; \
15+
exit 1; \
16+
fi; \
17+
echo "Waiting 2 minutes for EFS core file transfers"; sleep 120

0 commit comments

Comments
 (0)