From 398f7fd4194bbe941810684f54a09d4e172b87a6 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 12 May 2015 09:31:40 -0400 Subject: [PATCH] fedora-dev: carry over uid and gid --- fedora-dev/Dockerfile.in | 3 ++- fedora-dev/Makefile | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fedora-dev/Dockerfile.in b/fedora-dev/Dockerfile.in index abf7d29..c10fd48 100644 --- a/fedora-dev/Dockerfile.in +++ b/fedora-dev/Dockerfile.in @@ -33,7 +33,8 @@ RUN yum erase -y vim-minimal && \ tito && \ yum update -y && \ yum clean all && \ - useradd -m -u 1000 -G wheel,mock DEV_USER && \ + groupadd -g DEV_GID DEV_USER && \ + useradd -m -u DEV_UID -g DEV_GID -G wheel,mock DEV_USER && \ sed -ri 's/^(%wheel.*)(ALL)$/\1NOPASSWD: \2/' /etc/sudoers USER DEV_USER ENV HOME /home/DEV_USER diff --git a/fedora-dev/Makefile b/fedora-dev/Makefile index e039412..f7d243b 100644 --- a/fedora-dev/Makefile +++ b/fedora-dev/Makefile @@ -10,7 +10,12 @@ NAME ?= $(REGISTRY)/$(USER)/$(FROM_IMAGE)-dev:$(FROM_TAG) default: build Dockerfile: Dockerfile.in - m4 --define=DEV_USER=$(USER) --define=FROM_IMAGE=$(FROM) $< > $@ + m4 \ + --define=DEV_USER=$(USER) \ + --define=DEV_UID=$(shell id -u $(USER)) \ + --define=DEV_GID=$(shell id -g $(USER)) \ + --define=FROM_IMAGE=$(FROM) \ + $< > $@ build: .build