Skip to content

Commit 85021af

Browse files
committed
Set fixed Docker GID to avoid collisions with some groups
1 parent ddaa37c commit 85021af

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

build/install_base.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ install_essentials
5050
configure_sources
5151

5252
apt-get update
53+
# The docker group needs to run before installers
54+
groupadd -g "$(docker_group_id)" docker || :
5355
install_tools_apt
5456
install_tools
5557

build/tools.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,11 @@ function install_git-lfs() {
3838
rm -rf /tmp/lfs.tar.gz "/tmp/git-lfs-${GIT_LFS_VERSION}"
3939
}
4040

41-
function configure_docker_group_id() {
42-
local desired_gid="$(docker_group_id)"
43-
local current_gid=$(getent group docker | cut -d: -f3)
44-
45-
if [[ "$current_gid" != "$desired_gid" ]]; then
46-
# Expected to fail if the group already exists or the GID is already in use
47-
groupadd --system --gid "$desired_gid" docker 2>/dev/null || true
48-
fi
49-
}
50-
5141
function install_docker-cli() {
52-
configure_docker_group_id
53-
5442
apt-get install -y docker-ce-cli --no-install-recommends --allow-unauthenticated
5543
}
5644

5745
function install_docker() {
58-
configure_docker_group_id
59-
6046
apt-get install -y docker-ce docker-ce-cli docker-buildx-plugin containerd.io docker-compose-plugin --no-install-recommends --allow-unauthenticated
6147

6248
echo -e '#!/bin/sh\ndocker compose --compatibility "$@"' > /usr/local/bin/docker-compose

0 commit comments

Comments
 (0)