From 0b6326fe9182a8d7031940f92a527cf686fc382e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sun, 3 Jul 2022 18:14:49 +0200 Subject: [PATCH] Resolving the problem with the unavaiable start the docker machine with systemd in MacOS --- .local/bin/tester-ubuntu | 45 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.local/bin/tester-ubuntu b/.local/bin/tester-ubuntu index ba1f223..54d1dac 100755 --- a/.local/bin/tester-ubuntu +++ b/.local/bin/tester-ubuntu @@ -1,17 +1,32 @@ #!/bin/bash -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:latest +set -x + +# 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 \ - -d \ - -v $HOME/git/dev:/opt \ - --tmpfs /tmp \ - --tmpfs /run \ - --tmpfs /run/lock \ - --privileged \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ - jrei/systemd-ubuntu -container="$(docker ps --all | grep -i ubuntu | awk '{print $1}')" -sleep 15 && docker exec -it "$container" /bin/bash -docker stop "$container" > /dev/null -docker rm "$container" > /dev/null + -d \ + --name systemd-ubuntu \ + -v "$HOME/git/dev":/opt \ + --tmpfs /tmp \ + --tmpfs /run \ + --tmpfs /run/lock \ + --privileged \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + jrei/systemd-ubuntu:22.04 +# container="$(docker ps --all | grep -i ubuntu | awk '{print $1}')" +# sleep 15 && docker exec -it "$container" /bin/bash +# docker stop "$container" >/dev/null +# docker rm "$container" >/dev/null