0

I am using a publicly hosted docker project, but the documentation on running it with docker-compose is nonexistent.

Here is the docker run command:

docker run -d -v /persist/gravsite:/apps/var garywiz/docker-grav \
     --create-user anyuser:/apps/var

What I need to know is the equivalent for the --create-user in the docker-compose.yml file.

Here is my current entry:

grav:
    image: garywiz/docker-grav
    container_name: grav
    restart: always
    user: gravuser
    environment:
        - VIRTUAL_HOST=www.domain.com,domain.com
        - VIRTUAL_PORT=8080
    volumes:
        - /home/gravuser:/apps/var

Thanks for any help.

5
  • What is create user? Some argument passed to the docker-grav image? Commented Jun 15, 2017 at 22:57
  • I think so. I tried adding command: ["create-user","gravuser"] to the definition with no luck. Commented Jun 15, 2017 at 22:59
  • You'd need to use the same format. command: ["--create-user", "anyuser:/apps/var"] Commented Jun 15, 2017 at 23:01
  • Unfortunately, that still didn't work. Gave me the error: ERROR: for grav Cannot start service grav: linux spec user: unable to find user gravuser: no matching entries in passwd file. It works fine as a docker-run command though. Commented Jun 15, 2017 at 23:05
  • There are inconsistencies between your run and compose file, the volume for instance. As far as the command goes, that's equivalent, so there's something off about your environment. Can you share the entire compose file that's not working (as is) and the full docker run command that is working (as is). Commented Jun 15, 2017 at 23:25

1 Answer 1

1

If you want to translate the execution of the command in docker-compose, it would look like this:

this command:

docker run -d -v /persist/gravsite:/apps/var garywiz/docker-grav \
     --create-user anyuser:/apps/var

is equivalent to:

grav:
    image: garywiz/docker-grav
    volumes:
        - /persist/gravsite:/apps/var
    command: --create-user anyuser:/apps/var 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.