Skip Navigation
Lemmy Support @lemmy.ml Null User Object @lemmy.world

Issues setting up instance with docker

I'm trying to spin up an instance on a local VM for my own testing so using the docker install.

I've reaching the point the instructions that say to run docker-compose up -d.

When I run that as my normal non-root user, I get a permission denied error.

$ docker-compose up -d
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied

The first time I ran it with sudo, it downloaded a bunch of stuff (but to where I have no clue), and then gave the following error. Every subsequent run it skips the downloading (presumably because it already has all that), and goes straight to the error.

$ sudo docker-compose up -d
Creating network "lemmy_lemmyinternal" with driver "bridge"
Creating network "lemmy_lemmyexternalproxy" with the default driver
Pulling pictrs (asonix/pictrs:0.4.0-beta.19)...
0.4.0-beta.19: Pulling from asonix/pictrs
ef5531b6e74e: Pull complete
1f0396fae2e3: Pull complete
9115eac87d97: Pull complete
e38b3eb392e4: Pull complete
4d5295668c45: Pull complete
Digest: sha256:480d36cd97e5e98e7c76c7d226dc009bd5bb9fa065fdc1f4207699f16e8cc61e
Status: Downloaded newer image for asonix/pictrs:0.4.0-beta.19
Pulling postgres (postgres:15-alpine)...
15-alpine: Pulling from library/postgres
31e352740f53: Pull complete
d7c8ef16402f: Pull complete
36cb57831f52: Pull complete
a120e2610875: Pull complete
64f9e9ad23bd: Pull complete
dd2a4281faaa: Pull complete
daef310ca2c6: Pull complete
c47c060e762a: Pull complete
Digest: sha256:48d8422c6ae570a5bda52f07548b8e65dd055ac0b661f25b44b20e8cff2f75f0
Status: Downloaded newer image for postgres:15-alpine
Building lemmy
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/ME/docker: no such file or directory

It's clearly complaining about a missing file or folder in my home dir, but I have no idea what's supposed to be in that file/folder and it's not mentioned in the instructions. Suggestions?

ETA: Just to try something, I did a mkdir ~/docker and then touch ~/docker/Dockerfile, and now I get...

$ sudo docker-compose up -d
Building lemmy
Sending build context to Docker daemon  111.6MB
Error response from daemon: the Dockerfile (docker/Dockerfile) cannot be empty
ERROR: Service 'lemmy' failed to build : Build failed

Again. I have no idea what's supposed to be in that file. It's not mentioned in the instructions.

13

You're viewing a single thread.

13 comments
  • in yml instead

    build:
       context: ../
       dockerfile: docker/Dockerfile
    

    use:

    image: dessalines/lemmy:0.17.4

    • Well, that seems to have gotten a bit further, at least.

      Pulling lemmy (dessalines/lemmy:0.17.4)...
      0.17.4: Pulling from dessalines/lemmy
      8a49fdb3b6a5: Pull complete
      0de2c9bbcc62: Pull complete
      0f4c460d690c: Pull complete
      Digest: sha256:7aa2f62bf3217191797e374a6aa283b77d13632db2922335d0430029beb53b1d
      Status: Downloaded newer image for dessalines/lemmy:0.17.4
      Pulling lemmy-ui (dessalines/lemmy-ui:0.17.1)...
      0.17.1: Pulling from dessalines/lemmy-ui
      8921db27df28: Pull complete
      361849a0fe60: Pull complete
      4769d5fe84bb: Pull complete
      1a33b52da743: Pull complete
      b50526249338: Pull complete
      cdece431b19a: Pull complete
      Digest: sha256:b45e296a82c308c3839f3ce676df3b852aab519e21bd3d7b38e8d0064e95d25e
      Status: Downloaded newer image for dessalines/lemmy-ui:0.17.1
      Pulling proxy (nginx:1-alpine)...
      1-alpine: Pulling from library/nginx
      4db1b89c0bd1: Pull complete
      bd338968799f: Pull complete
      6a107772494d: Pull complete
      9f05b0cc5f6e: Pull complete
      4c5efdb87c4a: Pull complete
      c8794a7158bf: Pull complete
      8de2a93581dc: Pull complete
      768e67c521a9: Pull complete
      Digest: sha256:2d194184b067db3598771b4cf326cfe6ad5051937ba1132b8b7d4b0184e0d0a6
      Status: Downloaded newer image for nginx:1-alpine
      Creating lemmy_postgres_1 ... error
      Creating lemmy_pictrs_1   ... 
      
      ERROR: for lemmy_postgres_1  Cannot create container for service postgres: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.CCreating lemmy_pictrs_1   ... error
      
      ERROR: for lemmy_pictrs_1  Cannot create container for service pictrs: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.Config of type string
      
      ERROR: for postgres  Cannot create container for service postgres: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.Config of type string
      
      ERROR: for pictrs  Cannot create container for service pictrs: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.Config of type string
      ERROR: Encountered errors while bringing up the project.
      
      • I think I had that same error regarding numbers and strings: if you’re using that docker-compose file you need to put “” quotation marks around the number 4 in line 7, so it reads max-file: “4”

        You’re probably better off using the docker-compose.yml from the Ansible repo as your starting point and working from there, the one in the main repo is a bit of a mess as it’s being actively worked on at the minute.

        • Ok, that definitely helped. It now seems to run without errors...

          Creating lemmy_pictrs_1   ... done
          Creating lemmy_postgres_1 ... done
          Creating lemmy_lemmy_1    ... done
          Creating lemmy_lemmy-ui_1 ... done
          Creating lemmy_proxy_1    ... done
          

          But, then it just drops back to the command line. The docs say You can access the lemmy-ui at http://localhost:80, however, running a browser directly on the VM that lemmy is (supposedly) running on, and going to any of localhost:80, 127.0.0.1:80, the.machine.ip:80, all say unable to connect.

          Seems to be running?

          $ ps -ef | grep lemmy
          avahi        613       1  0 02:47 ?        00:00:02 avahi-daemon: running [lemmy.local]
          root       28970   28950  0 08:29 ?        00:00:00 /app/lemmy
          70         29018   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33172) idle
          70         29019   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33182) idle
          70         29020   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33188) idle
          70         29022   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33194) idle
          70         29024   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33204) idle
          70         29025   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33212) idle
          70         29026   27950  0 08:29 ?        00:00:00 postgres: lemmy lemmy 172.19.0.3(33216) idle
          

          Any tips on where to find logs, etc? I'm not even sure where it downloaded everything to, as it's not in the lemmy folder that the instructions had me create.

          ETA: netstat -lp doesn't seem to show it listening on any ports.

          • Try add port to proxy and check http://localhost:82

              proxy:
                ports:
                  - 82:80
                  - 1236:1236
                  - 8536:8536
            
            • Well, that resulted in something new.

              404: FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: connect ECONNREFUSED 172.20.0.4:8536
              

              ^^ Message in the browser window.

              • I had same issue, check if all ports are good i remember in some places there were UI on port 1234 and some 1236 in nginx.config, this config is a mess its esier write it from 0, also firewall can block your docker ip. But you are really close :D good luck

      • looks like you don't have folders for pictrs and postgres eg.

        volumes: - ./volumes/pictrs

        edit yml again :)

13 comments