-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from donkeyx/fix-build-process
fix: switched to slim and updated docker image
- Loading branch information
Showing
5 changed files
with
163 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
FROM alpine | ||
# Description: Dockerfile for the Sleeper service | ||
FROM debian:buster-slim | ||
|
||
# Metadata | ||
ARG VERSION=latest | ||
LABEL maintainer="David Binney <donkeysoft@gmail.com>" | ||
LABEL version=$VERSION | ||
LABEL description="This container is a utility for testing within cluster or networks and not needing to install tooling" | ||
|
||
# ENV LANG en_AU.UTF-8 | ||
# ENV LANGUAGE en_AU.UTF-8 | ||
# ENV LC_ALL en_AU.UTF-8 | ||
# ENV LC_CTYPE=en_AU.UTF-8 | ||
ENV TZ="Australia/Adelaide" | ||
# ENV DEBIAN_FRONTEND "noninteractive apt-get autoremove" | ||
|
||
WORKDIR /app | ||
|
||
COPY ./*.sh /app/ | ||
RUN apk add --no-cache \ | ||
bind-tools netcat-openbsd curl \ | ||
git jq vim tmux zsh \ | ||
postgresql-client redis mongodb-tools \ | ||
git nodejs | ||
|
||
RUN ./kickstart.sh | ||
# Update and install basic tools | ||
RUN apt-get update && apt-get install -y \ | ||
dnsutils netcat curl wget tar gnupg vim tmux zsh screenfetch && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install database clients | ||
RUN apt-get update && apt-get install -y \ | ||
postgresql-client redis-tools && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install programming languages and tools | ||
RUN apt-get update && apt-get install -y \ | ||
git golang && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT ["sh", "/app/sleeper.sh"] | ||
RUN apt-get update && apt-get install -y \ | ||
nodejs npm && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install MongoDB tools | ||
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - && \ | ||
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list && \ | ||
apt-get update && apt-get install -y mongodb-org-tools && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN ./kickstart.sh | ||
|
||
ENTRYPOINT ["zsh", "/app/sleeper.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: cluster-utils | ||
labels: | ||
app: cluster-utils | ||
purpose: testing | ||
spec: | ||
containers: | ||
- name: cluster-utils | ||
image: donkeyx/cluster-utils:latest | ||
env: | ||
- name: RUNTIME | ||
value: "1800" | ||
restartPolicy: Never | ||
|
||
template: | ||
spec: | ||
containers: | ||
- name: cluster-utils | ||
image: donkeyx/cluster-utils:latest | ||
env: | ||
- name: RUNTIME | ||
value: "1800" | ||
restartPolicy: Never | ||
ttlSecondsAfterFinished: 1800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
#!/usr/bin/env sh | ||
set -eou pipefail | ||
set -eu pipefail | ||
|
||
# # decent prompt | ||
echo "--- prompt setup zsh ---" | ||
|
||
apk add --no-cache zsh | ||
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" | ||
|
||
curl -sS -L https://github.com/tsenart/vegeta/releases/download/v12.8.3/vegeta-12.8.3-linux-amd64.tar.gz | tar -xz | ||
mv vegeta /usr/local/bin | ||
|
||
# apk add --no-cache screenfetch --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing | ||
# Create a new script that runs screenfetch and then prints the additional information | ||
cat <<EOF > ~/customfetch | ||
#!/usr/bin/env sh | ||
screenfetch | ||
cat <<INFO | ||
This container is useful for cluster and network testing with many tools. | ||
database connection tools: | ||
- psql, redis-cli, mongo | ||
network testing tools: | ||
- curl, wget, ping, traceroute, mtr, nmap, tcpdump, netcat | ||
performance testing tools: | ||
- vegeta, k6 | ||
programming languages: | ||
- golang, python, nodejs | ||
shell: | ||
- zsh with oh-my-zsh | ||
INFO | ||
EOF | ||
|
||
# echo "screenfetch" >> ~/.zshrc | ||
# echo "export PATH=$HOME/go/bin:$PATH" >> ~/.zshrc | ||
chmod +x ~/customfetch | ||
|
||
# Add customfetch to .zshrc so it runs whenever a new shell starts | ||
echo "~/customfetch" >> ~/.zshrc | ||
echo "export PATH=$HOME/go/bin:$PATH" >> ~/.zshrc | ||
|
||
echo "--- cleanup ---" | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf /tmp/* | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* |