diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ca69b8fa..20a4927e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -154,8 +154,6 @@ dockers: build_flag_templates: - "--platform=linux/amd64" - "--build-arg=EXTERNAL=1" - extra_files: - - entrypoint.sh skip_push: "{{ .Env.SKIP_PUSH }}" - image_templates: - "farmer1992/sshpiperd:v{{ .Version }}-arm64" @@ -170,8 +168,6 @@ dockers: build_flag_templates: - "--platform=linux/arm64" - "--build-arg=EXTERNAL=1" - extra_files: - - entrypoint.sh skip_push: "{{ .Env.SKIP_PUSH }}" # full - image_templates: @@ -182,8 +178,6 @@ dockers: build_flag_templates: - "--platform=linux/amd64" - "--build-arg=EXTERNAL=1" - extra_files: - - entrypoint.sh skip_push: "{{ .Env.SKIP_PUSH }}" - image_templates: - "farmer1992/sshpiperd:full-v{{ .Version }}-arm64" @@ -194,8 +188,6 @@ dockers: build_flag_templates: - "--platform=linux/arm64" - "--build-arg=EXTERNAL=1" - extra_files: - - entrypoint.sh skip_push: "{{ .Env.SKIP_PUSH }}" docker_manifests: - name_template: "farmer1992/sshpiperd:v{{ .Version }}" diff --git a/Dockerfile b/Dockerfile index 894819f5..2571d875 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM docker.io/golang:1.24-bookworm as builder - +FROM docker.io/golang:1.24-bookworm AS builder ARG VER=devel ARG BUILDTAGS ARG EXTERNAL=0 - ENV CGO_ENABLED=0 - WORKDIR /src + RUN \ --mount=target=/src,type=bind,source=. \ --mount=type=cache,target=/root/.cache/go-build \ @@ -22,13 +20,14 @@ RUN \ go build -o /sshpiperd/plugins -tags "${BUILDTAGS}" ./plugin/... ./e2e/testplugin/... fi HEREDOC -ADD entrypoint.sh /sshpiperd -FROM builder as testrunner + +FROM builder AS testrunner COPY --from=farmer1992/openssh-static:V_9_8_P1 /usr/bin/ssh /usr/bin/ssh-9.8p1 COPY --from=farmer1992/openssh-static:V_8_0_P1 /usr/bin/ssh /usr/bin/ssh-8.0p1 -FROM docker.io/busybox + +FROM docker.io/busybox AS sshpiperd ARG USERID=1000 ARG GROUPID=1000 RUN < 0 { diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 9d95435a..11f1f688 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -101,6 +101,7 @@ services: - SSHPIPERD_E2E_TEST=1 - SSHPIPERD_DEBUG=${SSHPIPERD_DEBUG} - SSHPIPERD_ALLOWED_PROXY_ADDRESSES=0.0.0.0/0 + - SSHPIPERD_SERVER_KEY_GENERATE_MODE=notexist - DOCKER_API_VERSION=1.40 build: context: ../ diff --git a/e2e/e2eentry.sh b/e2e/e2eentry.sh index c3a165c2..b44fba4d 100755 --- a/e2e/e2eentry.sh +++ b/e2e/e2eentry.sh @@ -1,9 +1,6 @@ #!/bin/bash set -x -# use entrypoint.sh to generate the ssh_host_ed25519_key -PLUGIN="dummy_badname/" bash /sshpiperd/entrypoint.sh 2>/dev/null - groupadd -f testgroup && \ useradd -m -G testgroup testgroupuser diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index d18376b5..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -set -eo pipefail - -PLUGIN=${PLUGIN:-workingdir} -export SSHPIPERD_SERVER_KEY_GENERATE_MODE=${SSHPIPERD_SERVER_KEY_GENERATE_MODE:-notexist} - -exec /sshpiperd/sshpiperd "${@:-/sshpiperd/plugins/$PLUGIN}"