Start the docker container in a shell script as follows:
#! /bin/bash
export EXE_FILE="rdbs_cbb_test aom_cell_test" ;
docker login -u admin -p admin123 registry:5000;
docker run --rm \
registry:5000/compiler/cmake-unit-test:v1.0 bash -c ' \
# EXE_FILE="rdbs_cbb_test aom_cell_test"; \
IFS=" " read -r -a arr <<< "$EXE_FILE"; \
for s in ${arr[@]}; \
do \
echo $s; \
done \
'
The script executed when docker run reads the value of the $EXE_FILE variable as null, and also tests the way to export the variable without using Export, but the $EXE_FILE is always null.
Can you tell me how to read the global variable in the docker run sh -c “”script?
I really appreciate it.
docker run ... bash -c ...
The following command uses double quotation marks, and the content part is changed to single quotation marks.