diff --git a/.github/workflows/build-and-push-docker-multiarch-image.yml b/.github/workflows/build-and-push-docker-multiarch-image.yml deleted file mode 100644 index 79b9a68..0000000 --- a/.github/workflows/build-and-push-docker-multiarch-image.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Image Build and Push - CI Workflow - -on: - push: - branches: - # master handles: "latest"; and tags "minimal" and "alpine-minimal" - - master - # alpine-extra handles itself "alpine-extra"; and tag "extra" - - alpine-extra - - tags: - - minimal - - alpine-minimal - - extra - -jobs: - build-and-push-muti-arch-docker-image: - runs-on: ubuntu-latest - env: - DOCKER_IMAGE: network-multitool - DOCKERHUB_ORGNAME: praqma - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # - # DOCKERHUB_USERNAME and DOCKERHUB_TOKEN are to be set in the GITHUB WEB UI, - # under RepoName -> Settings -> Secrets - - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Prepare Docker Image Tags - id: prep - run: | - SHORT_REF=$(basename ${GITHUB_REF}) - SHORT_HASH=${GITHUB_SHA::7} - TAGS="" - if [[ ! -z "${SHORT_REF}" && "${SHORT_REF}" == "master" ]]; then - echo "Found git commit on master branch. Setting docker image tag as: 'latest'" - TAG=${DOCKERHUB_ORGNAME}/${DOCKER_IMAGE}:latest - fi - if [[ ! -z "${SHORT_REF}" && "${SHORT_REF}" != "master" ]]; then - echo "Setting docker image tag as: '${SHORT_REF}'" - TAG=${DOCKERHUB_ORGNAME}/${DOCKER_IMAGE}:${SHORT_REF} - fi - TAGS="${TAG},${DOCKERHUB_ORGNAME}/${DOCKER_IMAGE}:${SHORT_HASH}" - echo "Complete Docker image-name and tags are setup as: ${TAGS}" - echo ::set-output name=tags::${TAGS} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x - push: true - tags: ${{ steps.prep.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 3e60534..d46d3fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM alpine:3.13 - -MAINTAINER Kamran Azeem & Henrik Høegh (kamranazeem@gmail.com, henrikrhoegh@gmail.com) +FROM alpine:3.22 EXPOSE 80 443 1180 11443 @@ -8,79 +6,21 @@ EXPOSE 80 443 1180 11443 # Packages are listed in alphabetical order, for ease of readability and ease of maintenance. RUN apk update \ && apk add bash bind-tools busybox-extras curl \ - iproute2 iputils jq mtr \ - net-tools nginx openssl \ - perl-net-telnet procps tcpdump tcptraceroute wget \ + iproute2 iputils jq mtr \ + mariadb-client postgresql16-client \ + net-tools nginx openssl \ + perl-net-telnet procps tcpdump tcptraceroute wget \ && mkdir /certs /docker \ && chmod 700 /certs \ && openssl req \ - -x509 -newkey rsa:2048 -nodes -days 3650 \ - -keyout /certs/server.key -out /certs/server.crt -subj '/CN=localhost' - - -# Copy a simple index.html to eliminate text (index.html) noise which comes with default nginx image. -# (I created an issue for this purpose here: https://github.com/nginxinc/docker-nginx/issues/234) + -x509 -newkey rsa:2048 -nodes -days 3650 \ + -keyout /certs/server.key -out /certs/server.crt -subj '/CN=localhost' COPY index.html /usr/share/nginx/html/ - COPY press-release.md /root/ COPY press-release.html /root/ - - -# Copy a custom/simple nginx.conf which contains directives -# to redirected access_log and error_log to stdout and stderr. -# Note: Don't use '/etc/nginx/conf.d/' directory for nginx virtual hosts anymore. -# This 'include' will be moved to the root context in Alpine 3.14. - COPY nginx.conf /etc/nginx/nginx.conf - COPY entrypoint.sh /docker/entrypoint.sh - -# Start nginx in foreground: CMD ["/usr/sbin/nginx", "-g", "daemon off;"] - - - -# Note: If you have not included the "bash" package, then it is "mandatory" to add "/bin/sh" -# in the ENTNRYPOINT instruction. -# Otherwise you will get strange errors when you try to run the container. -# Such as: -# standard_init_linux.go:219: exec user process caused: no such file or directory - -# Run the startup script as ENTRYPOINT, which does few things and then starts nginx. ENTRYPOINT ["/bin/sh", "/docker/entrypoint.sh"] - - - - - -################################################################################################### - -# Build and Push (to dockerhub) instructions: -# ------------------------------------------- -# docker build -t local/network-multitool . -# docker tag local/network-multitool praqma/network-multitool -# docker login -# docker push praqma/network-multitool - - -# Pull (from dockerhub): -# ---------------------- -# docker pull praqma/network-multitool - - -# Usage - on Docker: -# ------------------ -# docker run --rm -it praqma/network-multitool /bin/bash -# OR -# docker run -d praqma/network-multitool -# OR -# docker run -p 80:80 -p 443:443 -d praqma/network-multitool -# OR -# docker run -e HTTP_PORT=1180 -e HTTPS_PORT=11443 -p 1180:1180 -p 11443:11443 -d praqma/network-multitool - - -# Usage - on Kubernetes: -# --------------------- -# kubectl run multitool --image=praqma/network-multitool diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cb8b3c1 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +push: + docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/neuroxt/network-multitool:latest --push . \ No newline at end of file