Skip Navigation

Basic docker networking?

Hi guys! I'm going at my first docker attempt...and I'm going in Proxmox. I created an LXC container, from which I installed docker, and portainer. Portainer seems happy to work, and shows its admin page on port 9443 correctly. I tried next running the image of immich, following the steps detailed in their own guide. This...doesn't seem to open the admin website on port 2283. But then again, it seems to run in its own docker internal network (172.16.0.x). How should I reach immich admin page from another computer in the same network? I'm new to Docker, so I'm not sure how are images supposed to communicate within the normal computer network...Thanks!

27

You're viewing a single thread.

27 comments
  • I have Immich working fine inside an LXC with docker, You just gotta make sure that Keyctl and Nesting are activated in the LXC container's options in Proxmox and make sure to use the Immich recommended docker-compose file.

    If you still have problems try to take a look at the containers logs with the "docker logs" command to see if there's an error message somewhere.

    • Thanks! When I type my LXC's IP:2283, I get unable to connect. I checked the docker-compose.yml and the port seems to be 2283:3001, but no luck at either. Is there anything that needs to be done on docker's network in order to..."publish" a container to the local network so it can be seen? Or any docker running with a port can be reached via the host's IP with no further config? Checking the portainer's networks section, I can see an 'immich-default' network using bridge on 172.18.0.0/16, while the system's bridge seems to be running at 172.17.0.0/16. Is this the correct defaults? Should I change anything?

      Thanks!

      • That all seems correct, the way to expose services with a docker-compose is by using the:

        ports:
          - 2283:3001
        

        That means that you expose whatever is at port 3001 in the cointainer (in this case the Immich server inside the docker container, which is exposed by default to 3001) to port 2283 of the host machine (in this case, your LXC container). So it should work if everything else is set up correctly.

        The 172.x.x.x networks are normal internal networks for docker to use, normally you needn't care about them because you just expose whichever port you need via the ports command above.

        Are you following this step by step to set it all up? is your .env file properly set up? did you check the containers logs?

        • Thanks...I did follow their guide, step by step. The only thing that I customized was the immich uploads folder, which I want it to go to my NAS. I have it set up on an NFS mount handled by proxmox, and then it's just a transparent bind mount in the LXC. The user in the lxc container has read/write access to this location, and docker runs on this same user. But I reckon I'm addressing this in docker in a horribly messed way, as I've never used it before. Checking the docker logs immich_server, I'm getting this:

          [Nest] 7  - 04/08/2024, 9:53:08 AM     LOG [SystemConfigService] LogLevel=log (set via system config)
          node:fs:1380
            const result = binding.mkdir(
                                   ^
          
          Error: EACCES: permission denied, mkdir 'upload/library'
              at mkdirSync (node:fs:1380:26)
              at StorageRepository.mkdirSync (/usr/src/app/dist/repositories/storage.repository.js:112:37)
              at StorageService.init (/usr/src/app/dist/services/storage.service.js:30:32)
              at ApiService.init (/usr/src/app/dist/services/api.service.js:72:29)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async ApiModule.onModuleInit (/usr/src/app/dist/app.module.js:58:9)
              at async callModuleInitHook (/usr/src/app/node_modules/@nestjs/core/hooks/on-module-init.hook.js:51:9)
              at async NestApplication.callInitHook (/usr/src/app/node_modules/@nestjs/core/nest-application-context.js:223:13)
              at async NestApplication.init (/usr/src/app/node_modules/@nestjs/core/nest-application.js:100:9)
              at async NestApplication.listen (/usr/src/app/node_modules/@nestjs/core/nest-application.js:169:33) {
            errno: -13,
            code: 'EACCES',
            syscall: 'mkdir',
            path: 'upload/library'
          
          
          

          Let's see... So let's say my LXC container has a /mnt/NAS-immich-folder path, already mounted and with rw permissions. Then I edited my docker-compose.yml volumes line as follows:

              volumes:
                - /mnt/NAS-immich-folder:/mnt/immich
                - ${UPLOAD_LOCATION}:/mnt/immich
                - /etc/localtime:/etc/localtime:ro
          

          And my .env path looks like:

          # The location where your uploaded files are stored
          UPLOAD_LOCATION=/media/immich
          
          

          ...I'm sure I'm doing something horribly wrong besides the no-no of docker over LXC...Is there anything messed in these paths? What am I doing wrong? Thanks so much!

27 comments