Compare commits
6 Commits
5713b283ed
...
next
| Author | SHA1 | Date | |
|---|---|---|---|
| 2435201c80 | |||
| f6efe03551 | |||
| 41114ce60a | |||
| a1485030e8 | |||
| b8d90f2f8f | |||
| c7f2b8e9d2 |
19
.drone.yml
Normal file
19
.drone.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
21
Dockerfile
21
Dockerfile
@@ -1,14 +1,21 @@
|
|||||||
FROM phusion/baseimage:0.11
|
FROM ubuntu:focal
|
||||||
CMD ["/sbin/my_init"]
|
|
||||||
|
|
||||||
ADD ./sources.list /etc/apt/sources.list
|
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
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
ADD ./run.sh /tmp/run.sh
|
ADD ./run.sh /tmp/run.sh
|
||||||
RUN bash /tmp/run.sh && rm /tmp/run.sh
|
RUN bash /tmp/run.sh && rm /tmp/run.sh
|
||||||
|
|
||||||
# enable ssh
|
|
||||||
RUN rm -f /etc/service/sshd/down
|
|
||||||
|
|
||||||
#cleanup
|
#cleanup
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN apt-get clean && \
|
||||||
|
rm -rf \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/tmp/* \
|
||||||
|
/var/tmp/* \
|
||||||
|
/etc/ssh/ssh_host_*_key
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|||||||
7
Makefile
7
Makefile
@@ -4,9 +4,4 @@ BRANCH := $(shell git branch | sed -n -e 's/^\* \(.*\)/\1/p')
|
|||||||
default: build
|
default: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
script -q ./build.log docker build --no-cache -t sneak/sandbox .
|
script -q ./build.log docker build --no-cache -t sneak/sandbox:$(YYYYMMDD) .
|
||||||
docker tag sneak/sandbox sneak/sandbox:$(YYYYMMDD)
|
|
||||||
|
|
||||||
push:
|
|
||||||
docker push sneak/sandbox
|
|
||||||
docker push sneak/sandbox:$(YYYYMMDD)
|
|
||||||
|
|||||||
@@ -1,55 +1,11 @@
|
|||||||
# Usage
|
# sneak/sandbox
|
||||||
|
|
||||||
|
FIXME update this example command
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -d --name sandbox sneak/sandbox ;
|
docker run -d -p 22:22 -v /home:/home 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
|
# TODO
|
||||||
|
|
||||||
* ctags / enhanced vim
|
* ctags / enhanced vim
|
||||||
@@ -72,12 +28,12 @@ docker exec -ti sandbox script -q -c "TERM=xterm-color byobu" /dev/null
|
|||||||
|
|
||||||
Feedback is appreciated, PRs are encouraged.
|
Feedback is appreciated, PRs are encouraged.
|
||||||
|
|
||||||
Drop me an email or tweet [@sneakdotberlin](https://twitter.com/sneakdotberlin).
|
|
||||||
|
|
||||||
# Author
|
# Author
|
||||||
|
|
||||||
Jeffrey Paul <sneak@sneak.berlin>
|
Jeffrey Paul <sneak@sneak.berlin>
|
||||||
|
|
||||||
|
[sneak@sneak.berlin](mailto:sneak@sneak.berlin)
|
||||||
|
|
||||||
https://sneak.berlin
|
https://sneak.berlin
|
||||||
|
|
||||||
[@sneakdotberlin](https://twitter.com/sneakdotberlin)
|
[@sneakdotberlin](https://twitter.com/sneakdotberlin)
|
||||||
|
|||||||
60
run.sh
60
run.sh
@@ -5,6 +5,15 @@ set -x
|
|||||||
set -e
|
set -e
|
||||||
exec 1> >(tee -a /var/log/sandboxbuild.log) 2>&1
|
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="
|
PKGS="
|
||||||
apt-transport-https
|
apt-transport-https
|
||||||
apt-utils
|
apt-utils
|
||||||
@@ -25,6 +34,7 @@ PKGS="
|
|||||||
default-jre
|
default-jre
|
||||||
diffstat
|
diffstat
|
||||||
dnsutils
|
dnsutils
|
||||||
|
docker.io
|
||||||
dos2unix
|
dos2unix
|
||||||
editorconfig
|
editorconfig
|
||||||
ffmpeg
|
ffmpeg
|
||||||
@@ -44,6 +54,7 @@ PKGS="
|
|||||||
lcov
|
lcov
|
||||||
ldap-auth-client
|
ldap-auth-client
|
||||||
ldap-utils
|
ldap-utils
|
||||||
|
lftp
|
||||||
libasound2
|
libasound2
|
||||||
libatk1.0-0
|
libatk1.0-0
|
||||||
libboost-all-dev
|
libboost-all-dev
|
||||||
@@ -77,15 +88,11 @@ PKGS="
|
|||||||
pbzip2
|
pbzip2
|
||||||
pinentry-curses
|
pinentry-curses
|
||||||
pkg-config
|
pkg-config
|
||||||
pkg-config
|
|
||||||
psmisc
|
psmisc
|
||||||
pv
|
pv
|
||||||
pwgen
|
pwgen
|
||||||
python
|
|
||||||
python3
|
python3
|
||||||
python-dev
|
|
||||||
python3-dev
|
python3-dev
|
||||||
python-pip
|
|
||||||
python3-pip
|
python3-pip
|
||||||
rbenv
|
rbenv
|
||||||
rsync
|
rsync
|
||||||
@@ -125,10 +132,38 @@ apt update
|
|||||||
apt install -y neovim
|
apt install -y neovim
|
||||||
|
|
||||||
mkdir -p /etc/bashrc.d
|
mkdir -p /etc/bashrc.d
|
||||||
cat >> /etc/skel/.bashrc <<'EOF'
|
mkdir -p /etc/profile.d
|
||||||
|
|
||||||
|
cat >> /etc/bash.bashrc <<'EOF'
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
elif [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
for FN in /etc/bashrc.d/*.sh; do
|
for FN in /etc/bashrc.d/*.sh; do
|
||||||
source "$FN"
|
source "$FN"
|
||||||
done
|
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
|
EOF
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -138,7 +173,9 @@ EOF
|
|||||||
export NVM_DIR='/usr/local/nvm'
|
export NVM_DIR='/usr/local/nvm'
|
||||||
mkdir -p "$NVM_DIR"
|
mkdir -p "$NVM_DIR"
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
|
||||||
echo 'source /usr/local/nvm/nvm.sh' > /etc/bashrc.d/100.nvm.sh
|
cat > /etc/bashrc.d/100.nvm.sh <<'EOF'
|
||||||
|
source /usr/local/nvm/nvm.sh
|
||||||
|
EOF
|
||||||
source /etc/bashrc.d/100.nvm.sh
|
source /etc/bashrc.d/100.nvm.sh
|
||||||
|
|
||||||
nvm install node
|
nvm install node
|
||||||
@@ -183,7 +220,7 @@ done
|
|||||||
## install ppss, paralell processing shell script
|
## install ppss, paralell processing shell script
|
||||||
################################################################################
|
################################################################################
|
||||||
cd /usr/local/bin
|
cd /usr/local/bin
|
||||||
wget https://raw.githubusercontent.com/sneak/ppss/master/ppss
|
wget https://git.eeqj.de/sneak/ppss/raw/branch/master/ppss
|
||||||
chmod +x ./ppss
|
chmod +x ./ppss
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -201,8 +238,17 @@ PIP_PKGS="
|
|||||||
pipenv
|
pipenv
|
||||||
pylint
|
pylint
|
||||||
virtualenv
|
virtualenv
|
||||||
|
glances
|
||||||
"
|
"
|
||||||
|
|
||||||
for PKG in $PIP_PKGS; do
|
for PKG in $PIP_PKGS; do
|
||||||
pip3 install $PKG
|
pip3 install $PKG
|
||||||
done
|
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
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
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
|
|
||||||
Reference in New Issue
Block a user