Resolving the problem with the unavaiable start the docker machine with systemd in MacOS

This commit is contained in:
Marcin Woźniak 2022-07-03 18:14:49 +02:00
parent cb57699b6b
commit 0b6326fe91
Signed by: y0rune
GPG Key ID: F204C385F57EB348
1 changed files with 30 additions and 15 deletions

View File

@ -1,17 +1,32 @@
#!/bin/bash #!/bin/bash
docker stop "$(docker ps --all | grep -i ubuntu | awk '{print $1}')" > /dev/null set -x
docker rm "$(docker ps --all | grep -i ubuntu | awk '{print $1}')" > /dev/null
docker pull jrei/systemd-ubuntu:latest # Resolving problem with systemd in mac
# # Stop running Docker
# test -z "$(docker ps -q 2>/dev/null)" && osascript -e 'quit app "Docker"'
# # Install jq and moreutils so we can merge into the existing json file
# brew install jq moreutils
# # Add the needed cgroup config to docker settings.json
# echo '{"deprecatedCgroupv1": true}' |
# jq -s '.[0] * .[1]' ~/Library/Group\ Containers/group.com.docker/settings.json - |
# sponge ~/Library/Group\ Containers/group.com.docker/settings.json
# # Restart docker desktop
# open --background -a Docker
docker stop "$(docker ps --all | grep -i ubuntu | awk '{print $1}')" >/dev/null
docker rm "$(docker ps --all | grep -i ubuntu | awk '{print $1}')" >/dev/null
docker pull jrei/systemd-ubuntu:22.04
docker run \ docker run \
-d \ -d \
-v $HOME/git/dev:/opt \ --name systemd-ubuntu \
--tmpfs /tmp \ -v "$HOME/git/dev":/opt \
--tmpfs /run \ --tmpfs /tmp \
--tmpfs /run/lock \ --tmpfs /run \
--privileged \ --tmpfs /run/lock \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --privileged \
jrei/systemd-ubuntu -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
container="$(docker ps --all | grep -i ubuntu | awk '{print $1}')" jrei/systemd-ubuntu:22.04
sleep 15 && docker exec -it "$container" /bin/bash # container="$(docker ps --all | grep -i ubuntu | awk '{print $1}')"
docker stop "$container" > /dev/null # sleep 15 && docker exec -it "$container" /bin/bash
docker rm "$container" > /dev/null # docker stop "$container" >/dev/null
# docker rm "$container" >/dev/null