I want to set up a server with wireguard to use VPN from mobile devices, but when I start it I get the error Error: failed to spawn command: /init-wrapper: No such file or directory (os error 2)

Why can’t I start wireguard vpn server on fly?
When I deployed a got Error: failed to spawn command: /init-wrapper: No such file or directory (os error 2)

Dockerfile:

FROM ubuntu
ARG S6_OVERLAY_VERSION=3.1.4.1

RUN apt-get update && apt-get install -y xz-utils

ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz

COPY init-wrapper /
ENTRYPOINT ["/init-wrapper"]

init-wrapper:

#!/bin/sh
# run /init with PID 1, creating a new PID namespace if necessary
if [ "$$" -eq 1 ]; then
    # we already have PID 1
    exec /init "$@"
else
    # create a new PID namespace
    exec unshare --pid sh -c '
        # set up /proc and start the real init in the background
        unshare --mount-proc /init "$@" &
        child="$!"
        # forward signals to the real init
        trap "kill -INT \$child" INT
        trap "kill -TERM \$child" TERM
        # wait until the real init exits
        # ("wait" returns early on signals; "kill -0" checks if the process exists)
        until wait "$child" || ! kill -0 "$child" 2>/dev/null; do :; done
    ' sh "$@"
fi

fly.toml:

app = "name"
primary_region = "ams"

[build]
  dockerfile = "./Dockerfile"

[env]
  LOG_CONFS = "true"
  PEERDNS = "auto"
  PEERS = "1"
  PGID = "1000"
  PUID = "1000"
  SERVERPORT = "51820"

[[mounts]]
  source = "config"
  destination = "/config"
  auto_extend_size_threshold = 0

[[services]]
  protocol = "udp"
  internal_port = 51820

  [[services.ports]]
    port = 51820
  [services.concurrency]
    type = "connections"
    hard_limit = 25
    soft_limit = 20

[[vm]]
  cpu_kind = "shared"
  cpus = 1
  memory_mb = 512

Also i got message: does /init-wrapper exist and is it executable?
/init, /init-wrapper exist and executable, I checked it twice.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.