You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal aims to enrich the developer experience of imagetest_harness_docker module.
Abstract
By extending the capabilities of imagetest_harness_docker to handle multiple variables, we eliminate the need to manually write docker container run <ARGS> in each test script. Additionally, running the tests within the same network removes the necessity to execute networking-related tests in a separate container, which currently requires passing --network container:"${CONTAINER_NAME}".
Then we need to run the container inside the test script first:
0. Add required tools
apk add curl jq nodejs npm
1. Run the container first
docker run \
-d --rm \
-p 8080:8080 \
-p 9090:9090 \
-e FOO=BAR \
--name "${CONTAINER_NAME}" \
"${IMAGE_NAME}"
2. If you need to access ports, you need to set network
curl() {
docker run --network container:"${CONTAINER_NAME}" curl "$@"
}
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Could not connect to server
curl: (7) Failed to connect to localhost port 9090 after 0 ms: Could not connect to server
The text was updated successfully, but these errors were encountered:
This proposal aims to enrich the developer experience of
imagetest_harness_docker
module.Abstract
By extending the capabilities of
imagetest_harness_docker
to handle multiple variables, we eliminate the need to manually writedocker container run <ARGS>
in each test script. Additionally, running the tests within the same network removes the necessity to execute networking-related tests in a separate container, which currently requires passing--network container:"${CONTAINER_NAME}"
.Current Flow
Then we need to run the container inside the test script first:
Proposed Flow
Expose some variables to pass
docker container run
:In the test script:
apk add
for common tools.imagetest_harness_docker
will run the container by exposing the ports, etc.--network container:"${CONTAINER_NAME}"
.Current Behavior
The text was updated successfully, but these errors were encountered: