Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Create group before creating container user. #203

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions containers/systemd/init/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down