Compare commits
No commits in common. "next" and "master" have entirely different histories.
19
.drone.yml
19
.drone.yml
|
@ -1,19 +0,0 @@
|
|||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
build_args:
|
||||
- UBUNTU_MIRROR_URL=http://ubuntumirror.app.las1.eeqj.de/ubuntu
|
||||
repo: sneak/sandbox
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags:
|
||||
- ${DRONE_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
|
||||
- ${DRONE_COMMIT_SHA}
|
||||
- ${DRONE_BRANCH/\//-}
|
||||
- latest
|
14
Dockerfile
14
Dockerfile
|
@ -1,15 +1,15 @@
|
|||
FROM ubuntu:focal
|
||||
FROM phusion/baseimage:0.11
|
||||
CMD ["/sbin/my_init"]
|
||||
|
||||
ARG USERNAME_TO_ADD=user
|
||||
ARG UID_TO_ADD=1000
|
||||
ARG GID_TO_ADD=1000
|
||||
|
||||
ARG UBUNTU_MIRROR_URL=mirror://mirrors.ubuntu.com/mirrors.txt
|
||||
ADD ./sources.list /etc/apt/sources.list
|
||||
|
||||
# setup
|
||||
ADD ./run.sh /tmp/run.sh
|
||||
RUN bash /tmp/run.sh && rm /tmp/run.sh
|
||||
|
||||
# enable ssh
|
||||
RUN rm -f /etc/service/sshd/down
|
||||
|
||||
#cleanup
|
||||
RUN apt-get clean && \
|
||||
rm -rf \
|
||||
|
@ -17,5 +17,3 @@ RUN apt-get clean && \
|
|||
/tmp/* \
|
||||
/var/tmp/* \
|
||||
/etc/ssh/ssh_host_*_key
|
||||
|
||||
EXPOSE 22
|
||||
|
|
|
@ -1,11 +1,55 @@
|
|||
# sneak/sandbox
|
||||
|
||||
FIXME update this example command
|
||||
# Usage
|
||||
|
||||
```
|
||||
docker run -d -p 22:22 -v /home:/home sneak/sandbox
|
||||
docker run -d --name sandbox sneak/sandbox ;
|
||||
docker exec -ti sandbox script -q -c "TERM=xterm-color byobu" /dev/null
|
||||
```
|
||||
|
||||
(The 'script' bit works around a bug where `docker exec -t` doesn't
|
||||
give you a usable tty.)
|
||||
|
||||
Or, if you're clever and run an Ubuntu mirror (or caching reverse proxy) on
|
||||
your docker host:
|
||||
|
||||
```
|
||||
docker run -d --add-host archive.ubuntu.com:172.17.0.1 --name sandbox sneak/sandbox ;
|
||||
docker exec -ti sandbox script -q -c "TERM=xterm-color byobu" /dev/null
|
||||
```
|
||||
|
||||
# Includes Things Like
|
||||
|
||||
* vim
|
||||
* neovim
|
||||
* rbenv
|
||||
* default-jre
|
||||
* docker (from docker)
|
||||
* docker-compose
|
||||
* docker-machine
|
||||
* bash completion
|
||||
* python (from ubuntu)
|
||||
* setuptools
|
||||
* virtualenv
|
||||
* node4 (from ubuntu)
|
||||
* coffeescript
|
||||
* coffeelint
|
||||
* go1.6 (from ubuntu)
|
||||
* byobu and screen
|
||||
* awscli (from pypi)
|
||||
* irssi
|
||||
* runit / daemontools
|
||||
* envdir
|
||||
* build-essential
|
||||
* make
|
||||
* latex and fonts (from ubuntu)
|
||||
* Other useful misc tools
|
||||
* pv
|
||||
* pbzip2
|
||||
* nmap
|
||||
* ppss
|
||||
* pwgen
|
||||
* netcat and telnet
|
||||
* and much more...
|
||||
|
||||
# TODO
|
||||
|
||||
* ctags / enhanced vim
|
||||
|
@ -28,12 +72,12 @@ docker run -d -p 22:22 -v /home:/home sneak/sandbox
|
|||
|
||||
Feedback is appreciated, PRs are encouraged.
|
||||
|
||||
Drop me an email or tweet [@sneakdotberlin](https://twitter.com/sneakdotberlin).
|
||||
|
||||
# Author
|
||||
|
||||
Jeffrey Paul <sneak@sneak.berlin>
|
||||
|
||||
[sneak@sneak.berlin](mailto:sneak@sneak.berlin)
|
||||
|
||||
https://sneak.berlin
|
||||
|
||||
[@sneakdotberlin](https://twitter.com/sneakdotberlin)
|
||||
|
|
39
run.sh
39
run.sh
|
@ -1,19 +1,12 @@
|
|||
#!/bin/bash
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
USERNAME="sneak"
|
||||
|
||||
set -x
|
||||
set -e
|
||||
exec 1> >(tee -a /var/log/sandboxbuild.log) 2>&1
|
||||
|
||||
MURM="main universe restricted multiverse"
|
||||
C="focal"
|
||||
cat > /etc/apt/sources.list.new <<EOF
|
||||
deb $UBUNTU_MIRROR_URL $C $MURM
|
||||
deb $UBUNTU_MIRROR_URL $C-updates $MURM
|
||||
deb $UBUNTU_MIRROR_URL $C-backports $MURM
|
||||
deb $UBUNTU_MIRROR_URL $C-security $MURM
|
||||
EOF
|
||||
|
||||
PKGS="
|
||||
apt-transport-https
|
||||
apt-utils
|
||||
|
@ -54,7 +47,6 @@ PKGS="
|
|||
lcov
|
||||
ldap-auth-client
|
||||
ldap-utils
|
||||
lftp
|
||||
libasound2
|
||||
libatk1.0-0
|
||||
libboost-all-dev
|
||||
|
@ -88,11 +80,15 @@ PKGS="
|
|||
pbzip2
|
||||
pinentry-curses
|
||||
pkg-config
|
||||
pkg-config
|
||||
psmisc
|
||||
pv
|
||||
pwgen
|
||||
python
|
||||
python3
|
||||
python-dev
|
||||
python3-dev
|
||||
python-pip
|
||||
python3-pip
|
||||
rbenv
|
||||
rsync
|
||||
|
@ -147,22 +143,10 @@ for FN in /etc/bashrc.d/*.sh; do
|
|||
source "$FN"
|
||||
done
|
||||
|
||||
if [[ -d "$HOME/.bashrc.d" ]]; then
|
||||
for FN in /etc/bashrc.d/*.sh; do
|
||||
source "$FN"
|
||||
done
|
||||
fi
|
||||
|
||||
if ! shopt -oq posix; then
|
||||
for FN in /etc/profile.d/*.sh; do
|
||||
source "$FN"
|
||||
done
|
||||
|
||||
if [[ -d "$HOME/.profile.d" ]]; then
|
||||
for FN in /etc/profile.d/*.sh; do
|
||||
source "$FN"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
@ -220,7 +204,7 @@ done
|
|||
## install ppss, paralell processing shell script
|
||||
################################################################################
|
||||
cd /usr/local/bin
|
||||
wget https://git.eeqj.de/sneak/ppss/raw/branch/master/ppss
|
||||
wget https://raw.githubusercontent.com/sneak/ppss/master/ppss
|
||||
chmod +x ./ppss
|
||||
|
||||
################################################################################
|
||||
|
@ -238,7 +222,6 @@ PIP_PKGS="
|
|||
pipenv
|
||||
pylint
|
||||
virtualenv
|
||||
glances
|
||||
"
|
||||
|
||||
for PKG in $PIP_PKGS; do
|
||||
|
@ -248,7 +231,7 @@ done
|
|||
################################################################################
|
||||
## add working user and add to sudo nopassword
|
||||
################################################################################
|
||||
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD
|
||||
useradd -u $UID_TO_ADD -g $GID_TO_ADD -s /bin/bash $USERNAME_TO_ADD
|
||||
usermod -p '*' $USERNAME_TO_ADD
|
||||
echo "$USERNAME_TO_ADD ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
groupadd -g 1000 $USERNAME
|
||||
useradd -u 1000 -g 1000 -s /bin/bash $USERNAME
|
||||
usermod -p '*' $USERNAME
|
||||
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
deb mirror://mirrors.ubuntu.com/mirrors.txt bionic main universe multiverse restricted
|
||||
deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-updates main universe multiverse restricted
|
||||
deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-security main universe multiverse restricted
|
||||
deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-backports main universe multiverse restricted
|
Loading…
Reference in New Issue