1
0
Fork 0

initial version

This commit is contained in:
Pim van den Berg 2022-09-09 11:37:37 +02:00
commit 86a763e0d9
5 changed files with 84 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM debian:bookworm-slim
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
openssh-server \
curl \
telnet \
net-tools \
screen \
; \
rm -rf /var/lib/apt/lists/*
ADD start.sh /
EXPOSE 22/tcp
CMD /start.sh
HEALTHCHECK CMD netstat -tnlp | grep '0.0.0.0:22' || exit 1

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Jumpbox Docker container
* Debian slim based image
* OpenSSH server
# Supported tags and respective `Dockerfile` links
- [`latest`](https://git.nethuis.nl/pommi/docker-jumpbox/Dockerfile)
# Usage
```
$ docker run -it \
--name jumpbox \
-v $(pwd)/authorized_keys:/root/.ssh/authorized_keys \
-p 1022:22 \
pommib/jumpbox:latest
```
# docker-compose
```
version: "3"
services:
jumpbox:
container_name: jumpbox
image: pommib/jumpbox:latest
ports:
- "1022:22/tcp"
volumes:
- '${PWD}/authorized_keys:/root/.ssh/authorized_keys'
```

9
build.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -x
IMAGE=pommib/jumpbox:latest
docker pull $IMAGE
docker pull debian:bookworm-slim
docker build --no-cache -t $IMAGE ./
docker push $IMAGE

14
rebuild.sh Executable file
View 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/jumpbox:latest; then
./build.sh
fi

7
start.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
mkdir -p /run/sshd
chown root: /root/.ssh/authorized_keys
exec /usr/sbin/sshd -D -e