From 4940810ddf7012765a4a141b588518d5284430ff Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 16 Jun 2014 20:41:44 -0400 Subject: [PATCH] Create group before creating container user. --- containers/systemd/init/templates.go | 1 + 1 file changed, 1 insertion(+) diff --git a/containers/systemd/init/templates.go b/containers/systemd/init/templates.go index b143d295..b8e1dbac 100644 --- a/containers/systemd/init/templates.go +++ b/containers/systemd/init/templates.go @@ -21,6 +21,7 @@ type ContainerInitScript struct { var ContainerInitTemplate = template.Must(template.New("container-init.sh").Parse(`#!/bin/sh {{ if .CreateUser }} if command -v useradd >/dev/null; then + groupadd -g {{.Gid}} {{.ContainerUser}} useradd -u {{.Uid}} -g {{.Gid}} {{.ContainerUser}} else adduser -u {{.Uid}} -g {{.Gid}} {{.ContainerUser}}