1

According to the documentation, you can use a bunch of options (like --log, --user, etc.) to start a SurrealDB instance if it's installed locally.

But can I use flag options if I want to use the Docker image? I´ve tried running docker container run -p 8000:8000 --name surreal surrealdb/surrealdb:latest "start -p root memory" but I get this message, which is from SurrealDB:

error: The subcommand 'start -p root memory' wasn't recognized

        Did you mean 'start'?

If you believe you received this message in error, try re-running with 'surreal -- start -p root memory'

USAGE:
    surreal [SUBCOMMAND]

For more information try --help

The documentation doesn't specify this use case of Docker SurrealDB instances.

Tovar
  • 99
  • 2
  • 6
  • Try taking the quotes away, so they're not being passed as a single argument – jonrsharpe Sep 28 '22 at 12:42
  • Since you are using docker, why are you passing the `memory` option? Also, you can just run `docker run --rm -p 8000:8000 surrealdb/surrealdb:latest start -p root`. – Juan Fontes Sep 28 '22 at 12:52

1 Answers1

3

The example command on the github page https://github.com/surrealdb/surrealdb#run-using-docker does not have hyphens and just ran without error for me.

docker run --rm --name surrealdb -p 127.0.0.1:8000:8000 surrealdb/surrealdb:latest start --log trace --user root --pass root memory

Most likely you can adjust it to your needs.

miriess
  • 164
  • 5