adding an xterm container example

This commit is contained in:
Vincent Batts 2014-07-08 08:56:15 -04:00
parent de25821d54
commit 66ca2324db
2 changed files with 51 additions and 0 deletions

18
xterm/Dockerfile.sh Normal file
View file

@ -0,0 +1,18 @@
#!/bin/sh
cat <<EOM
FROM fedora:latest
RUN yum install -y xterm
#RUN yum update -y && yum clean all
RUN useradd -m -u $(id -u ${USER}) -G wheel ${USER} && \
sed -ri 's/^(%wheel.*)(ALL)$/\1NOPASSWD: \2/' /etc/sudoers
CMD bash -l
USER ${USER}
ENV HOME ${HOME}
WORKDIR ${HOME}
EOM

33
xterm/Makefile Normal file
View file

@ -0,0 +1,33 @@
COMMAND := xterm
IMAGE := $(USER)/$(COMMAND)
DOCKER := $(shell which docker)
default: run
Dockerfile: Dockerfile.sh
sh $< > $@
build: Dockerfile
$(DOCKER) build -t $(IMAGE) .
run: build
$(DOCKER) run \
--rm \
-it \
--hostname="$(shell hostname)-$(IMAGE)" \
--env DISPLAY \
--env HOME \
--env PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin \
--env SESSION_MANAGER \
--env SSH_AUTH_SOCK \
--env XAUTHORITY \
--privileged \
--user $(USER) \
--workdir $(shell pwd) \
-v $(HOME):$(HOME) \
-v $(SSH_AUTH_SOCK):$(SSH_AUTH_SOCK) \
-v /tmp/:/tmp/ \
$(IMAGE) \
$(COMMAND)