1

i hope someone can help me here.

I am creating a linux Setup for my server. I need vhosts and only want to use docker-compose to have better track of security and setup and to easily restart and add new container.

For vhosting and ssl i use nginx-proxy (https://github.com/nginx-proxy/nginx-proxy). It works like a charm out of the box. Current docker-compose.yml:

services:
        proxy:
                image: nginxproxy/nginx-proxy:alpine
                ports:
                        - "80:80"
                        - "443:443"
                volumes:
                        - certs:/etc/nginx/certs
                        - vhost:/etc/nginx/vhost.d
                        - html:/usr/share/nginx/html
                        - /var/run/docker.sock:/tmp/docker.sock:ro
                container_name: proxy
                restart: always

        ssl:
                image: nginxproxy/acme-companion
                environment:
                        - "DEFAULT_EMAIL=<MYEMAIL>"
                volumes_from:
                        - proxy:rw
                volumes:
                        - /var/run/docker.sock:/var/run/docker.sock:ro
                        - acme:/etc/acme.sh
                container_name: ssl-management
                restart: always
networks:
        default:
                name: proxy-net

volumes:
        certs:
                external: false
        vhost:
                external: false
        html:
                external: false
        acme:
                external: false

I got all services running.

Currently im trying to start a mail server on the same server and ip. As mentioned i want to start (if possible) everything with docker so i got in touch with mailu (https://github.com/Mailu/Mailu) and as an alternative with mailcow (https://mailcow.email/)

I used the default setup for mailu from https://setup.mailu.io/1_7/ and configured everything as mentioned.

docker-compose.yml for mailu

version: '2.2'

services:

  # External dependencies
  redis:
    image: redis:alpine
    restart: always
    volumes:
      - "/home/vhost/mailserver/mailu/redis:/data"

  # Core services
  front:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    logging:
      driver: json-file
    ports:
      - 25
      - 465
      - 587
      - 110
      - 995
      - 143
      - 993
    volumes:
      - "/home/vhost/mailserver/mailu/overrides/nginx:/overrides"
    expose:
      - 80
      - 443
    environment:
      - VIRTUAL_HOST=mail.<MYDOMAIN>.com
      - LETSENCRYPT_HOST=mail.<MYDOMAIN>.com
    networks:
      - proxy-net

  admin:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/home/vhost/mailserver/mailu/data:/data"
      - "/home/vhost/mailserver/mailu/dkim:/dkim"
    depends_on:
      - redis

  imap:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/home/vhost/mailserver/mailu/mail:/mail"
      - "/home/vhost/mailserver/mailu/overrides:/overrides"
    depends_on:
      - front

  smtp:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/home/vhost/mailserver/mailu/overrides:/overrides"
    depends_on:
      - front


  antispam:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/home/vhost/mailserver/mailu/filter:/var/lib/rspamd"
      - "/home/vhost/mailserver/mailu/dkim:/dkim"
      - "/home/vhost/mailserver/mailu/overrides/rspamd:/etc/rspamd/override.d"
    depends_on:
      - front

  # Optional services



  # Webmail
  webmail:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}roundcube:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/home/vhost/mailserver/mailu/webmail:/data"
    depends_on:
      - imap
networks:
  default:
    driver: bridge
    name: mail-net
  proxy-net:

Now the Problem. If i start first nginx-proxy and second mailu (or mailcow, same result, with or without nginx-proxy VIRTUALHOST settings and Port change) I get error:

Creating mailu_redis_1 ... done
Creating mailu_front_1 ... done
Creating mailu_admin_1 ... 
Creating mailu_smtp_1     ... error
Creating mailu_antispam_1 ... 
Creating mailu_imap_1     ... 

Creating mailu_imap_1     ... error

ERROR: for mailu_imap_1  Cannot start service imap: runtime: failed to create new OS thread (have 6 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

goroutine 20 [running]:
runtime.throw(0x98a876, 0x9)
    /usr/local/go/src/runtime/panic.go:774 +0x72 fp=0xc00003d5f0 sp=0xc00003d5c0 pc=0x42dd12
runtime.newosproc(0xc00008d880)
    /usr/local/go/src/runtime/os_linux.go:153 +0x1ba fp=0xc00003d650 sp=0xc00003d5f0 pc=0x42b5da
runtime.newm1(0xc00008d880)
    /usr/local/go/src/runtime/proc.go:1853 +0xdc fp=0xc00003d690 sp=0xc00003d650 pc=0x4335dc
runtime.newm(0x9a7f78, 0x0)
    /usr/local/go/src/runtime/proc.go:1832 +0x8f fp=0xc00003d6c0 sp=0xc00003d690 pc=0x43344f
runtime.startTemplateThread()
    /usr/local/go/src/runtime/proc.go:1873 +0xa9 fp=0xc00003d6e8 sp=0xc00003d6c0 pc=0x4336c9
runtime.LockOSThread()
    /usr/local/go/src/runtime/proc.go:3543 +0x6b fp=0xc00003d708 sp=0xc00003d6e8 pc=0x437f2b
runtime.ensureSigM.func1()
    /usr/local/go/src/runtime/signal_unix.go:535 +0x34 fp=0xc00003d7e0 sp=0xc00003d708 pc=0x4584a4
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00003d7e8 sp=0xc00003d7e0 pc=0x45ae51
created by runtime.ensureSigM
    /usr/local/go/src/runtime/signal_unix.go:532 +0xd5

goroutine 1 [chan send]:
os/signal.signal_enable(0x8b7cf98f0000000f)
    /usr/local/go/src/runtime/sigqueue.go:219 +0x6c
os/signal.enableSignal(...)
    /usr/local/go/src/os/signal/signal_unix.go:50
os/signal.Notify.func1(0xf)
    /usr/local/go/src/os/signal/signal.go:135 +0x8e
os/signal.Notify(0xc0000a05a0, 0xc0000a0600, 0x4, 0x6)
    /usr/local/go/src/os/signal/signal.go:147 +0x182
github.com/containerd/containerd/runtime/v2/shim.setupSignals(0x0, 0xc000000180, 0x9a7c18, 0xc0000dda10)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim_unix.go:44 +0xc3
github.com/containerd/containerd/runtime/v2/shim.run(0x9903a5, 0x15, 0x9a6840, 0x0, 0x0, 0x0)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:172 +0x37b
github.com/containerd/containerd/runtime/v2/shim.Run(0x9903a5, 0x15, 0x9a6840, 0x0, 0x0, 0x0)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:153 +0xc4
main.main()
    /go/src/github.com/containerd/containerd/cmd/containerd-shim-runc-v2/main.go:27 +0x53

goroutine 18 [runnable]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:21
created by os/signal.init.0
    /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 19 [runnable]:
github.com/containerd/containerd/runtime/v2/shim.setRuntime.func1()
Creating mailu_admin_1    ... done
created by github.com/containerd/containerd/runtime/v2/shim.setRuntime
Creating mailu_antispam_1 ... done
: exit status 2: unknown

ERROR: for smtp  Cannot start service smtp: ttrpc: closed: unknown

ERROR: for imap  Cannot start service imap: runtime: failed to create new OS thread (have 6 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

goroutine 20 [running]:
runtime.throw(0x98a876, 0x9)
    /usr/local/go/src/runtime/panic.go:774 +0x72 fp=0xc00003d5f0 sp=0xc00003d5c0 pc=0x42dd12
runtime.newosproc(0xc00008d880)
    /usr/local/go/src/runtime/os_linux.go:153 +0x1ba fp=0xc00003d650 sp=0xc00003d5f0 pc=0x42b5da
runtime.newm1(0xc00008d880)
    /usr/local/go/src/runtime/proc.go:1853 +0xdc fp=0xc00003d690 sp=0xc00003d650 pc=0x4335dc
runtime.newm(0x9a7f78, 0x0)
    /usr/local/go/src/runtime/proc.go:1832 +0x8f fp=0xc00003d6c0 sp=0xc00003d690 pc=0x43344f
runtime.startTemplateThread()
    /usr/local/go/src/runtime/proc.go:1873 +0xa9 fp=0xc00003d6e8 sp=0xc00003d6c0 pc=0x4336c9
runtime.LockOSThread()
    /usr/local/go/src/runtime/proc.go:3543 +0x6b fp=0xc00003d708 sp=0xc00003d6e8 pc=0x437f2b
runtime.ensureSigM.func1()
    /usr/local/go/src/runtime/signal_unix.go:535 +0x34 fp=0xc00003d7e0 sp=0xc00003d708 pc=0x4584a4
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00003d7e8 sp=0xc00003d7e0 pc=0x45ae51
created by runtime.ensureSigM
    /usr/local/go/src/runtime/signal_unix.go:532 +0xd5

goroutine 1 [chan send]:
os/signal.signal_enable(0x8b7cf98f0000000f)
    /usr/local/go/src/runtime/sigqueue.go:219 +0x6c
os/signal.enableSignal(...)
    /usr/local/go/src/os/signal/signal_unix.go:50
os/signal.Notify.func1(0xf)
    /usr/local/go/src/os/signal/signal.go:135 +0x8e
os/signal.Notify(0xc0000a05a0, 0xc0000a0600, 0x4, 0x6)
    /usr/local/go/src/os/signal/signal.go:147 +0x182
github.com/containerd/containerd/runtime/v2/shim.setupSignals(0x0, 0xc000000180, 0x9a7c18, 0xc0000dda10)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim_unix.go:44 +0xc3
github.com/containerd/containerd/runtime/v2/shim.run(0x9903a5, 0x15, 0x9a6840, 0x0, 0x0, 0x0)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:172 +0x37b
github.com/containerd/containerd/runtime/v2/shim.Run(0x9903a5, 0x15, 0x9a6840, 0x0, 0x0, 0x0)
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:153 +0xc4
main.main()
    /go/src/github.com/containerd/containerd/cmd/containerd-shim-runc-v2/main.go:27 +0x53

goroutine 18 [runnable]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:21
created by os/signal.init.0
    /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 19 [runnable]:
github.com/containerd/containerd/runtime/v2/shim.setRuntime.func1()
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:119
created by github.com/containerd/containerd/runtime/v2/shim.setRuntime
    /go/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:119 +0x41
: exit status 2: unknown
ERROR: Encountered errors while bringing up the project.

If i run mailu without nginx-proxy running there is no error and it works perfectly.

I am out of ideas what the problem could be. There is no same port exposed and i cant see any same used dependencies what could be a problem. And the mentioned ulimit is set to 10000. There is nothing else running on this server, i dont think this should be a problem ether.

I hope you got some more experience with this kind and can help me.

Greeting

Max11251
  • 31
  • 2

0 Answers0