added docker sandbox, work in progress
This commit is contained in:
		
							parent
							
								
									5a6f30ec0f
								
							
						
					
					
						commit
						8bba66dfa7
					
				
							
								
								
									
										10
									
								
								sandbox/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								sandbox/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| FROM ubuntu:16.04 | ||||
| 
 | ||||
| RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d | ||||
| ADD ./sources.list /etc/apt/sources.list | ||||
| ADD ./run.sh /tmp/run.sh | ||||
| RUN bash /tmp/run.sh && rm /tmp/run.sh | ||||
| ADD ./my_init /usr/sbin/my_init | ||||
| RUN chmod +x /usr/sbin/my_init | ||||
| CMD /usr/sbin/my_init | ||||
| 
 | ||||
							
								
								
									
										7
									
								
								sandbox/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								sandbox/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | ||||
| default: build | ||||
| 
 | ||||
| build: | ||||
| 	docker build -t sneak/sandbox . | ||||
| 
 | ||||
| push: build | ||||
| 	docker push sneak/sandbox | ||||
							
								
								
									
										9
									
								
								sandbox/README.markdown
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								sandbox/README.markdown
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| # TODO | ||||
| 
 | ||||
| * ctags / enhanced vim | ||||
| * screenrc or byobu config | ||||
| * customize PS1 | ||||
| * more shells | ||||
| * more editors (emacs) | ||||
| * rbenv build versions | ||||
| * LaTeX and fonts and whatnot | ||||
							
								
								
									
										9
									
								
								sandbox/my_init
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								sandbox/my_init
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| export > /etc/environment | ||||
| /usr/sbin/runsvdir-start & | ||||
| sleep 1 | ||||
| if [[ ! -e /var/log/syslog ]]; then | ||||
|     touch /var/log/syslog | ||||
| fi | ||||
| exec tail -qf /var/log/syslog /etc/service/*/log/*.log | ||||
							
								
								
									
										102
									
								
								sandbox/run.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								sandbox/run.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,102 @@ | ||||
| #!/bin/bash | ||||
| export DEBIAN_FRONTEND=noninteractive | ||||
| 
 | ||||
| PKGS=" | ||||
|     apt-utils | ||||
|     bind9-host | ||||
|     bonnie++ | ||||
|     build-essential | ||||
|     byobu | ||||
|     command-not-found | ||||
|     daemontools | ||||
|     debmirror | ||||
|     docker | ||||
|     fortune | ||||
|     git | ||||
|     irssi | ||||
|     jq | ||||
|     ldap-auth-client | ||||
|     ldap-utils | ||||
|     lsof | ||||
|     libxml2 | ||||
|     libxml2-dev | ||||
|     mailutils | ||||
|     make | ||||
|     mosh | ||||
|     mutt | ||||
|     nmap | ||||
|     nodejs | ||||
|     npm | ||||
|     nscd | ||||
|     pbzip2 | ||||
|     pv | ||||
|     pwgen | ||||
|     python | ||||
|     python-dev | ||||
|     python-pip | ||||
|     rbenv | ||||
|     rsync | ||||
|     rsyslog | ||||
|     rsyslog-gnutls | ||||
|     rsyslog-relp | ||||
|     runit | ||||
|     screen | ||||
|     snmp | ||||
|     snmp-mibs-downloader | ||||
|     snmpd | ||||
|     telnet | ||||
|     texlive-latex-base | ||||
|     tmux | ||||
|     vagrant | ||||
|     vim | ||||
|     wamerican-insane | ||||
|     wget | ||||
| " | ||||
| 
 | ||||
| apt-get update | ||||
| apt-get -y upgrade | ||||
| apt-get install -y $PKGS | ||||
| 
 | ||||
| # use faster one: | ||||
| OLD="$(which bzip2)" | ||||
| rm $OLD | ||||
| ln $(which pbzip2) $OLD | ||||
| 
 | ||||
| git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build | ||||
| 
 | ||||
| cd /usr/local/bin | ||||
| wget https://raw.githubusercontent.com/sneak/ppss/master/ppss | ||||
| chmod +x ./ppss | ||||
| 
 | ||||
| NPM_PKGS=" | ||||
|     coffee-script | ||||
|     coffeelint | ||||
| " | ||||
| 
 | ||||
| # update npm | ||||
| npm update -g --loglevel info npm | ||||
| for PKG in $NPM_PKGS ; do | ||||
|     npm install -g --loglevel info $PKG | ||||
| done | ||||
| 
 | ||||
| PIP_PKGS=" | ||||
|     virtualenv | ||||
|     pylint | ||||
|     awscli | ||||
| " | ||||
| 
 | ||||
| pip install --upgrade pip | ||||
| pip install setuptools | ||||
| pip install pip-review | ||||
| pip-review --verbose --auto | ||||
| for PKG in $PIP_PKGS; do | ||||
|     pip install $PKG | ||||
| done | ||||
| 
 | ||||
| # cleanup | ||||
| 
 | ||||
| rm -rf \ | ||||
|     /root/.cache \ | ||||
|     /var/cache/* \ | ||||
|     /var/lib/apt/lists/* \ | ||||
|     /core | ||||
							
								
								
									
										4
									
								
								sandbox/sources.list
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								sandbox/sources.list
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | ||||
| deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted universe multiverse | ||||
| deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted universe multiverse | ||||
| deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports main restricted universe multiverse | ||||
| deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted universe multiverse | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user