Compare commits

..

No commits in common. "master" and "b7c64622c92adc19cbf0f30f002f52a59d0b6cf7" have entirely different histories.

11 changed files with 125 additions and 324 deletions

75
.drone.yml Normal file
View File

@ -0,0 +1,75 @@
kind: pipeline
type: docker
name: build-image-x86_64
steps:
- name: build-image-latest
image: docker.io/volkerraschek/build-image:latest
commands:
- make container-image/build
volumes:
- name: docker_socket
path: /var/run/docker.sock
when:
branch:
- master
- name: push-image-latest
image: docker.io/volkerraschek/build-image:latest
commands:
- make container-image/push
environment:
CONTAINER_IMAGE_REGISTRY_PASSWORD:
from_secret: container_image_registry_password
volumes:
- name: docker_socket
path: /var/run/docker.sock
when:
branch:
- master
- name: delete-image-latest
image: docker.io/volkerraschek/build-image:latest
commands:
- make container-image/delete
volumes:
- name: docker_socket
path: /var/run/docker.sock
when:
branch:
- master
- name: push-readme
image: docker.io/volkerraschek/build-image:latest
commands:
- make push/README
environment:
CONTAINER_IMAGE_REGISTRY_PASSWORD:
from_secret: container_image_registry_password
volumes:
- name: docker_socket
path: /var/run/docker.sock
when:
branch:
- master
- name: notify
image: drillster/drone-email
environment:
PLUGIN_HOST:
from_secret: smtp_host
PLUGIN_USERNAME:
from_secret: smtp_username
PLUGIN_PASSWORD:
from_secret: smtp_password
PLUGIN_FROM:
from_secret: smtp_mail_address
when:
status:
- changed
- failure
volumes:
- name: docker_socket
host:
path: /var/run/docker.sock

View File

@ -1,22 +0,0 @@
name: 'Lint Markdown files'
on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
workflow_dispatch: {}
jobs:
markdown-lint:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
with:
globs: '**/*.md'

View File

@ -1,99 +0,0 @@
name: Release
on:
push:
branches:
- master
jobs:
push-arm64:
runs-on: ubuntu-latest-arm64
steps:
- uses: actions/checkout@v4.2.2
- uses: docker/setup-qemu-action@v3.6.0
- uses: docker/setup-buildx-action@v3.10.0
- uses: docker/login-action@v3.4.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Build and push image
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
docker buildx build \
--file Dockerfile \
--platform linux/arm64 \
--provenance false \
--push \
--tag git.cryptic.systems/volker.raschek/network-tools:${TAG}-arm64 \
.
push-amd64:
runs-on: ubuntu-latest-amd64
steps:
- uses: actions/checkout@v4.2.2
- uses: docker/setup-qemu-action@v3.6.0
- uses: docker/setup-buildx-action@v3.10.0
- uses: docker/login-action@v3.4.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Build and push image
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
docker buildx build \
--file Dockerfile \
--platform linux/amd64 \
--provenance false \
--push \
--tag git.cryptic.systems/volker.raschek/network-tools:${TAG}-amd64 \
.
push-manifest:
runs-on: ubuntu-latest
needs:
- push-arm64
- push-amd64
steps:
- uses: docker/login-action@v3.4.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Create and push manifest
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
docker manifest create git.cryptic.systems/volker.raschek/network-tools:${TAG} \
--amend git.cryptic.systems/volker.raschek/network-tools:${TAG}-amd64 \
--amend git.cryptic.systems/volker.raschek/network-tools:${TAG}-arm64
docker manifest push git.cryptic.systems/volker.raschek/network-tools:${TAG}
sync-to-hub-docker-io:
needs:
- push-manifest
runs-on: ubuntu-latest
steps:
- name: Copy images to docker.io
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
apt-get update --yes
apt-get install --yes skopeo
skopeo copy \
--all \
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
--src-username volker.raschek \
docker://git.cryptic.systems/volker.raschek/network-tools:${TAG} \
docker://docker.io/volkerraschek/network-tools:${TAG}

View File

@ -1,22 +0,0 @@
name: Update Docker Hub Description
on:
push:
branches:
- master
paths:
- README.md
workflow_dispatch: {}
jobs:
update-description-on-hub-docker-io:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: peter-evans/dockerhub-description@v4.0.2
with:
username: ${{ secrets.DOCKER_IO_USERNAME }}
password: ${{ secrets.DOCKER_IO_PASSWORD }}
repository: volkerraschek/network-tools
readme-filepath: README.md

View File

@ -1,136 +0,0 @@
# markdownlint YAML configuration
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# Default state for all rules
default: true
# Path to configuration file to extend
extends: null
# MD003/heading-style/header-style - Heading style
MD003:
# Heading style
style: "atx"
# MD004/ul-style - Unordered list style
MD004:
style: "dash"
# MD007/ul-indent - Unordered list indentation
MD007:
# Spaces for indent
indent: 2
# Whether to indent the first level of the list
start_indented: false
# MD009/no-trailing-spaces - Trailing spaces
MD009:
# Spaces for line break
br_spaces: 2
# Allow spaces for empty lines in list items
list_item_empty_lines: false
# Include unnecessary breaks
strict: false
# MD010/no-hard-tabs - Hard tabs
MD010:
# Include code blocks
code_blocks: true
# MD012/no-multiple-blanks - Multiple consecutive blank lines
MD012:
# Consecutive blank lines
maximum: 1
# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 120
# Number of characters for headings
heading_line_length: 120
# Number of characters for code blocks
code_block_line_length: 120
# Include code blocks
code_blocks: false
# Include tables
tables: false
# Include headings
headings: true
# Strict length checking
strict: false
# Stern length checking
stern: false
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
MD022:
# Blank lines above heading
lines_above: 1
# Blank lines below heading
lines_below: 1
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
MD025:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD026/no-trailing-punctuation - Trailing punctuation in heading
MD026:
# Punctuation characters
punctuation: ".,;:!。,;:!"
# MD029/ol-prefix - Ordered list item prefix
MD029:
# List style
style: "one_or_ordered"
# MD030/list-marker-space - Spaces after list markers
MD030:
# Spaces for single-line unordered list items
ul_single: 1
# Spaces for single-line ordered list items
ol_single: 1
# Spaces for multi-line unordered list items
ul_multi: 1
# Spaces for multi-line ordered list items
ol_multi: 1
# MD033/no-inline-html - Inline HTML
MD033:
# Allowed elements
allowed_elements: []
# MD035/hr-style - Horizontal rule style
MD035:
# Horizontal rule style
style: "---"
# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
MD036:
# Punctuation characters
punctuation: ".,;:!?。,;:!?"
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD044/proper-names - Proper names should have the correct capitalization
MD044:
# List of proper names
names: []
# Include code blocks
code_blocks: false
# MD046/code-block-style - Code block style
MD046:
# Block style
style: "fenced"
# MD048/code-fence-style - Code fence style
MD048:
# Code fence syle
style: "backtick"

View File

@ -1,5 +1,5 @@
FROM docker.io/library/alpine:3.22.0
ARG BASE_IMAGE
RUN apk add bind-tools curl iputils
FROM ${BASE_IMAGE}
ENTRYPOINT [ "sleep", "3600" ]
RUN apk add bind-tools curl iputils

View File

@ -1,41 +1,62 @@
# CONTAINER_RUNTIME
# The CONTAINER_RUNTIME variable will be used to specified the path to a
# container runtime. This is needed to start and run a container image.
CONTAINER_RUNTIME?=$(shell which podman)
CONTAINER_RUNTIME?=$(shell which docker)
# NETWORKTOOLS_IMAGE_REGISTRY_NAME
# BASE_IMAGE
# Defines the name of the container base image on which should be built the new
# CONTAINER_IMAGE.
BASE_IMAGE_REGISTRY_NAME:=docker.io
BASE_IMAGE_NAMESPACE:=library
BASE_IMAGE_NAME:=alpine
BASE_IMAGE_VERSION:=3.11.2
BASE_IMAGE_FULL=${BASE_IMAGE_REGISTRY_NAME}/${BASE_IMAGE_NAMESPACE}/${BASE_IMAGE_NAME}:${BASE_IMAGE_VERSION}
BASE_IMAGE_SHORT=${BASE_IMAGE_NAMESPACE}/${BASE_IMAGE_NAME}:${BASE_IMAGE_VERSION}
# CONTAINER_IMAGE_REGISTRY_NAME
# Defines the name of the new container to be built using several variables.
NETWORKTOOLS_IMAGE_REGISTRY_NAME?=git.cryptic.systems
NETWORKTOOLS_IMAGE_REGISTRY_USER?=volker.raschek
CONTAINER_IMAGE_REGISTRY_NAME:=docker.io
CONTAINER_IMAGE_REGISTRY_USER:=volkerraschek
NETWORKTOOLS_IMAGE_NAMESPACE?=${NETWORKTOOLS_IMAGE_REGISTRY_USER}
NETWORKTOOLS_IMAGE_NAME:=network-tools
NETWORKTOOLS_IMAGE_VERSION?=latest
NETWORKTOOLS_IMAGE_FULLY_QUALIFIED=${NETWORKTOOLS_IMAGE_REGISTRY_NAME}/${NETWORKTOOLS_IMAGE_NAMESPACE}/${NETWORKTOOLS_IMAGE_NAME}:${NETWORKTOOLS_IMAGE_VERSION}
CONTAINER_IMAGE_NAMESPACE?=${CONTAINER_IMAGE_REGISTRY_USER}
CONTAINER_IMAGE_NAME:=network-tools
CONTAINER_IMAGE_VERSION?=latest
CONTAINER_IMAGE_FULL=${CONTAINER_IMAGE_REGISTRY_NAME}/${CONTAINER_IMAGE_NAMESPACE}/${CONTAINER_IMAGE_NAME}:${CONTAINER_IMAGE_VERSION}
CONTAINER_IMAGE_SHORT=${CONTAINER_IMAGE_NAMESPACE}/${CONTAINER_IMAGE_NAME}:${CONTAINER_IMAGE_VERSION}
# BUILD CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/build
container-image/build:
${CONTAINER_RUNTIME} build \
--build-arg BASE_IMAGE=${BASE_IMAGE_FULL} \
--file Dockerfile \
--no-cache \
--pull \
--tag ${NETWORKTOOLS_IMAGE_FULLY_QUALIFIED} \
--tag ${CONTAINER_IMAGE_FULL} \
--tag ${CONTAINER_IMAGE_SHORT} \
.
# DELETE CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/delete
container-image/delete:
- ${CONTAINER_RUNTIME} image rm ${NETWORKTOOLS_IMAGE_FULLY_QUALIFIED}
- ${CONTAINER_RUNTIME} image rm ${CONTAINER_IMAGE_FULL} ${CONTAINER_IMAGE_SHORT}
- ${CONTAINER_RUNTIME} image rm ${BASE_IMAGE_FULL}
# PUSH CONTAINER IMAGE
# ==============================================================================
PHONY+=container-image/push
container-image/push:
echo ${NETWORKTOOLS_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${NETWORKTOOLS_IMAGE_REGISTRY_NAME} --username ${NETWORKTOOLS_IMAGE_REGISTRY_USER} --password-stdin
${CONTAINER_RUNTIME} push ${NETWORKTOOLS_IMAGE_FULLY_QUALIFIED}
echo ${CONTAINER_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${CONTAINER_IMAGE_REGISTRY_NAME} --username ${CONTAINER_IMAGE_REGISTRY_USER} --password-stdin
${CONTAINER_RUNTIME} push ${CONTAINER_IMAGE_FULL}
# PUSH README
# ==============================================================================
PHONY+=push/README
push/README:
echo ${CONTAINER_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${CONTAINER_IMAGE_REGISTRY_NAME} --username ${CONTAINER_IMAGE_REGISTRY_USER} --password-stdin
docker pushrm ${CONTAINER_IMAGE_FULL}
# PHONY
# ==============================================================================

View File

@ -1,10 +1,13 @@
# network-tools
[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/network-tools/status.svg)](https://drone.cryptic.systems/volker.raschek/network-tools)
[![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/network-tools)](https://hub.docker.com/r/volkerraschek/network-tools)
This project contains all sources to build the container image `git.cryptic.systems/volker.raschek/network-tools`. The
primary goal of the image is only to contain some network tools to debug container based environments like docker or
kubernetes.
This project, hosted on
[git.cryptic.systems](https://git.cryptic.systems/volker.raschek/network-tools),
contains only files to build the container image. The container image contains
network tools to analyse or monitor network communication. This can be helpful
in a containerized environment.
## Usage
@ -13,16 +16,16 @@ kubernetes.
To use this image execute the following command in a docker environment.
```bash
docker run \
--entrypoint /bin/sh \
-it \
--rm \
git.cryptic.systems/volker.raschek/network-tools:latest
$ docker run \
--rm \
volkerraschek/network-tools:latest \
sh
```
### Kubernetes
For a kubernetes environment you can use the [YAML-File](network-tools.yaml) by executing the following command.
For a kubernetes environment you can use the [YAML-File](network-tools.yaml) by
executing the following command.
```bash
kubectl create -f https://git.cryptic.systems/volker.raschek/network-tools/raw/branch/master/network-tools.yml

View File

@ -1,4 +0,0 @@
version: "3"
services:
network-tools:
image: git.cryptic.systems/volker.raschek/network-tools:latest

View File

@ -5,15 +5,9 @@ metadata:
spec:
containers:
- name: network-tools
image: git.cryptic.systems/volker.raschek/network-tools:latest
image: docker.io/volkerraschek/network-tools:latest
command: [ "sleep", "3600" ]
imagePullPolicy: Always
resources:
limits:
cpu: 250m
memory: 250Mi
requests:
cpu: 100m
memory: 125Mi
securityContext:
capabilities :
add:

View File

@ -1,9 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>volker.raschek/renovate-config:default#master",
"local>volker.raschek/renovate-config:container#master",
"local>volker.raschek/renovate-config:actions#master",
"local>volker.raschek/renovate-config:regexp#master"
]
}