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
host.docker.internal is not accessible via GitHub actions. There are two alternative approaches available, as below (which should be documented properly):
It should be possible to add host.docker.internal within docker-entrypoint.sh if the Docker container is running within a GitHub Action with something like the below, however there are issues with this as /etc/hosts is not available to the non-root user:
# Check if running inside a GitHub Action
if [ -n "$GITHUB_ACTIONS" ]; then
echo "Running inside GitHub Actions. Adding host.docker.internal to /etc/hosts."
echo "172.17.0.1 host.docker.internal" >> /etc/hosts
fi
A more robust solution would be to do something like the equivalent of docker create --add-host=host.docker.internal:host-gateway (where host-gateway replaces 172.17.0.1), within the GitHub action.yml. It's not clear if this is supported.
host.docker.internal
is not accessible via GitHub actions. There are two alternative approaches available, as below (which should be documented properly):Use a “container” for the job, which allows a “network-alias” to be configured, which can then be used to access the container (where the booking system resides) from the test suite. Full example here: https://github.com/openactive/OpenActive.Server.NET/blob/feature/docker-image/.github/workflows/docker-test-3.yml
Use the static IP of 172.17.0.1, which can be used to access the host (where the booking system resides) from the test suite. This does not require a “container” to be used. Full example here: https://github.com/openactive/OpenActive.Server.NET/blob/feature/docker-image/.github/workflows/docker-test-4.yml
It should be possible to add
host.docker.internal
withindocker-entrypoint.sh
if the Docker container is running within a GitHub Action with something like the below, however there are issues with this as/etc/hosts
is not available to the non-root user:A more robust solution would be to do something like the equivalent of
docker create --add-host=host.docker.internal:host-gateway
(wherehost-gateway
replaces172.17.0.1
), within the GitHubaction.yml
. It's not clear if this is supported.Additionally it should also be possible to trust host certificates, to allow reference implementation to be fully tested via Docker, as per https://serverfault.com/questions/1150886/docker-giving-container-access-to-hosts-ca-certs
The text was updated successfully, but these errors were encountered: