fedora-dev: carry over uid and gid

This commit is contained in:
Vincent Batts 2015-05-12 09:31:40 -04:00
parent 57c47d0cdc
commit 398f7fd419
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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