angristan / docker-pleroma

Docker image for the Pleroma federated social network
https://git.pleroma.social/pleroma/pleroma/
MIT License
352 stars 77 forks source link

Service 'web' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder081051733/config/secret.exs: no such file or directory #13

Closed poperigby closed 4 years ago

poperigby commented 4 years ago

I'm getting this error when trying to build Pleroma. I have /config/secret.exs, so I don't know what it's complaining about.

This is my current file structure:

.
├── build
│   └── Dockerfile
├── config
│   └── secret.exs
├── db (just a bunch of postgres stuff in here)
├── docker-compose.yml
└── uploads

This is my docker-compose.yml:

version: '2.3'

services:
  db:
    image: postgres:9.6-alpine
    container_name: pleroma-db
    restart: always
    environment:
      POSTGRES_USER: pleroma
      POSTGRES_PASSWORD: pleroma
      POSTGRES_DB: pleroma
    volumes:
      - ./db:/var/lib/postgresql/data

  web:
    build: ./build
    image: pleroma
    container_name: pleroma-web
    restart: always
    ports:
      - '127.0.0.1:4000:4000'
    volumes:
      - ./uploads:/pleroma/uploads
    depends_on:
      - db
angristan commented 4 years ago

The Dockerfile uses a relative path:

https://github.com/angristan/docker-pleroma/blob/32c1aa4809a67a77f3cf32bc5c66036914f77407/Dockerfile#L22

You put the Dockerfile in a build folder, and build/config/secret.exs doesn't exist. My guess is that this is the problem

poperigby commented 4 years ago

Ok, I moved the Dockerfile out of build. Now I get this though:

warning: variable "clX9o1" does not exist and is being expanded to "clX9o1()", please use parentheses to remove the ambiguity or change the variable name
  config/prod.secret.exs:6

** (CompileError) config/prod.secret.exs:6: undefined function clX9o1/0
    (stdlib 3.12.1) lists.erl:1354: :lists.mapfoldl/3
    (stdlib 3.12.1) lists.erl:1354: :lists.mapfoldl/3
ERROR: Service 'web' failed to build: The command '/bin/sh -c mix local.rebar --force     && mix local.hex --force     && mix deps.get     && mix compile' returned a non-zero code: 1
angristan commented 4 years ago

Mmh, did you put the secret between double quotes?

poperigby commented 4 years ago

That was the problem. Thanks!

poperigby commented 4 years ago

On Wednesday, August 5, 2020 12:23:42 PM PDT Stanislas wrote:

Mmh, did you put the secret between double quotes? Looks like that was the problem