Skip to content

Instantly share code, notes, and snippets.

@val314159
Created September 1, 2016 22:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save val314159/91d0ac017918c78a09a4c951aa48e652 to your computer and use it in GitHub Desktop.
Save val314159/91d0ac017918c78a09a4c951aa48e652 to your computer and use it in GitHub Desktop.
Docker Makefile
NAME=vvm
all: clean build rund ;
clean: ; rm -f Dockerfile ; docker rm -f $(NAME) ; true
build: Dockerfile ; docker build --tag $(NAME) . && rm Dockerfile
runi: ; docker run -it --name $(NAME) $(NAME)
rund: ; docker run -d --name $(NAME) $(NAME)
exec: ; docker exec -it $(NAME) /bin/bash -c "TERM=$(TERM) exec bash"
ps: ; docker ps
Dockerfile: Makefile ; echo "$$DOCKERFILE" >Dockerfile
######################################## ######################################
export DOCKERFILE
define DOCKERFILE
FROM ubuntu:latest
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install apt-utils
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install build-essential emacs wget curl telnet
RUN apt-get -y install python python-gevent python-bottle
RUN apt-get -y install ipython
RUN apt-get -y install screen
RUN echo >> /bin/loop '#!/bin/bash'
RUN echo >> /bin/loop 'while : ; do date ; sleep 10; done'
RUN chmod +x /bin/loop
WORKDIR /root
RUN echo 'exec >/dev/tty 2>/dev/tty </dev/tty' >>/root/.bashrc
#CMD /bin/bash -c 'while : ; do date ; sleep 10; done'
CMD /bin/loop
endef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment