init
This commit is contained in:
commit
64e1fc08e4
90
.drone.yml
Normal file
90
.drone.yml
Normal file
@ -0,0 +1,90 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
commands:
|
||||
- sleep 5 # give docker enough time to start
|
||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||
- ./build.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
command:
|
||||
- dockerd-entrypoint.sh
|
||||
- dockerd
|
||||
- --host=unix:///var/run/docker.sock
|
||||
- --mtu=1492
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: rebuild
|
||||
|
||||
steps:
|
||||
- name: rebuild
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
commands:
|
||||
- sleep 5 # give docker enough time to start
|
||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||
- ./rebuild.sh
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
command:
|
||||
- dockerd-entrypoint.sh
|
||||
- dockerd
|
||||
- --host=unix:///var/run/docker.sock
|
||||
- --mtu=1492
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
cron:
|
||||
- rebuild
|
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@ -0,0 +1,37 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN set -eux && \
|
||||
apt-get update && \
|
||||
export DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
arping \
|
||||
ca-certificates \
|
||||
curl \
|
||||
dnsutils \
|
||||
iproute2 \
|
||||
iptables \
|
||||
iputils-ping \
|
||||
jq \
|
||||
less \
|
||||
locales \
|
||||
mtr-tiny \
|
||||
net-tools \
|
||||
netcat-openbsd \
|
||||
openssh-client \
|
||||
openssl \
|
||||
psmisc \
|
||||
screen \
|
||||
tcpdump \
|
||||
telnet \
|
||||
traceroute \
|
||||
vim \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
|
||||
/usr/sbin/locale-gen && \
|
||||
/usr/sbin/update-locale 'LANG=en_US.UTF-8'
|
||||
|
||||
ADD start.sh /
|
||||
WORKDIR /root
|
||||
CMD /start.sh
|
18
README.md
Normal file
18
README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Swiss Army Knife container
|
||||
|
||||
* Debian slim based image
|
||||
* A lot of tools...
|
||||
|
||||
# Supported tags and respective `Dockerfile` links
|
||||
|
||||
- [`latest`](https://git.nethuis.nl/pommi/docker-swiss/Dockerfile)
|
||||
|
||||
# Usage
|
||||
|
||||
## docker run
|
||||
|
||||
```
|
||||
$ docker run -it \
|
||||
--name swiss \
|
||||
pommib/swiss:latest
|
||||
```
|
9
build.sh
Executable file
9
build.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
IMAGE=pommib/swiss:latest
|
||||
docker pull $IMAGE
|
||||
docker pull debian:bookworm-slim
|
||||
docker build --no-cache -t $IMAGE ./
|
||||
docker push $IMAGE
|
14
rebuild.sh
Executable file
14
rebuild.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
updates_available () {
|
||||
docker pull "$1"
|
||||
if test "$(docker run -it --rm "$1" /bin/sh -c 'apt -qqq update && apt -qq list --upgradable')" != ""; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
if updates_available pommib/swiss:latest; then
|
||||
./build.sh
|
||||
fi
|
Loading…
Reference in New Issue
Block a user