[rootless docker] Remove DOCKER_HOST environment when toggling between rootless and root docker

This commit is contained in:
John Robbins 2023-04-11 09:04:07 -06:00
parent 218e162054
commit 19df19c432

View File

@ -75,6 +75,13 @@
command: /usr/bin/dockerd-rootless-setuptool.sh uninstall --force
when: docker_rootless == false and rootless_conf.stat.exists
- name: Reset DOCKER_HOST environment
lineinfile:
path: /etc/environment
state: absent
regexp: '^DOCKER_HOST=unix:///run/user/.*/docker.sock$'
when: docker_rootless == false and rootless_conf.stat.exists
- name: Ensure Docker is started and enabled at boot
service:
name: docker