robotframework-docker-action icon indicating copy to clipboard operation
robotframework-docker-action copied to clipboard

Request the network flag with docker run command

Open Thanawat1997 opened this issue 2 years ago • 0 comments

Hi, I request to add the network flag in the docker run command on test.sh because the main problem that I found I can't access another container on the same machine in GitHub Action.

Example:

...
Task Setup      Open Browser  http://localhost:7600/
...

Please, add variable to support network type something like this:

# Create reports folder
REPORTS_DIR=$(pwd)/$ROBOT_REPORTS_DIR
TESTS_DIR=$(pwd)/$ROBOT_TESTS_DIR
sudo mkdir $REPORTS_DIR && sudo chmod 777 $REPORTS_DIR

# Add the docker to support network type
docker run --shm-size=$ALLOWED_SHARED_MEMORY \
  --network="$NETWORK_TYPE"
  -e BROWSER=$BROWSER \
  -e ROBOT_THREADS=$ROBOT_THREADS \
  -e PABOT_OPTIONS="$PABOT_OPTIONS" \
  -e ROBOT_OPTIONS="$ROBOT_OPTIONS" \
  -v $REPORTS_DIR:/opt/robotframework/reports:Z \
  -v $TESTS_DIR:/opt/robotframework/tests:Z \
  --user $(id -u):$(id -g) \
  $ROBOT_RUNNER_IMAGE
# action.yml
...
network_type:
    description: 'Docker network type'
    required: true
    default: 'host'
...

Thank you.

Thanawat1997 avatar Dec 16 '22 05:12 Thanawat1997