Skip to content

Commit 46c774f

Browse files
authored
Add dns into docker json
1 parent 18eb49a commit 46c774f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/executor/runner.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,16 @@ export default async function runConfig(payload) {
510510
await writeLog(await dockerExec.enableDocker(domaindata['Username']));
511511
await sshExec(`mkdir -p ~/.config/docker ~/.config/systemd/user/docker.service.d`, false);
512512
await sshExec(`[[ -z $DOCKER_HOST ]] && echo "export DOCKER_HOST=unix:///run/user/\\$(id -u)/docker.sock" >> ~/.bashrc`);
513-
await sshExec(`printf '{\\n\\t"exec-opts": ["native.cgroupdriver=cgroupfs"],\\n\\t"host-gateway-ip": "10.0.2.2"\\n}\\n' > ~/.config/docker/daemon.json`);
514-
await sshExec(`printf '[Service]\\nEnvironment="DOCKERD_ROOTLESS_ROOTLESSKIT_NET=pasta"\\nEnvironment="DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=implicit"\\nEnvironment="DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false"\\n' > ~/.config/systemd/user/docker.service.d/override.conf`);
513+
await sshExec(`printf '{\\n\\t${[
514+
`"exec-opts": ["native.cgroupdriver=cgroupfs"]`,
515+
`"host-gateway-ip": "10.0.2.2"`,
516+
`"dns": ["1.1.1.1", "1.0.0.1"]"`,
517+
].join(',\\n\\t')}\\n}\\n' > ~/.config/docker/daemon.json`);
518+
await sshExec(`printf '${[`[Service]`,
519+
`Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_NET=pasta"`,
520+
`Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=implicit"`,
521+
`Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false"`
522+
].join('\\n')}\\n' > ~/.config/systemd/user/docker.service.d/override.conf`);
515523
await sshExec(`dockerd-rootless-setuptool.sh install --skip-iptables`);
516524
await sshExec(`[[ -z $DOCKER_HOST ]] || (systemctl daemon-reload --user; systemctl restart docker --user)`);
517525
await sshExec(`export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock`, false);

0 commit comments

Comments
 (0)