dockest
Version:
Dockest is an integration testing tool aimed at alleviating the process of evaluating unit tests whilst running multi-container Docker applications.
19 lines • 886 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fixRunnerHostAccessOnLinux = void 0;
const constants_1 = require("../../constants");
const execa_wrapper_1 = require("../../utils/execa-wrapper");
const fixRunnerHostAccessOnLinux = async ({ containerId, logger }) => {
const command = `docker exec ${containerId} \
/bin/sh -c "ip -4 route list match 0/0 \
| awk '{print \\$3\\" ${constants_1.DEFAULT_HOST_NAME}\\"}' \
>> /etc/hosts"`;
try {
(0, execa_wrapper_1.execaWrapper)(command);
}
catch (err) {
logger.debug('Fixing the host container access failed. This could be related to the container having already been stopped');
}
};
exports.fixRunnerHostAccessOnLinux = fixRunnerHostAccessOnLinux;
//# sourceMappingURL=fix-runner-host-access-on-linux.js.map