New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Docker CLI Access #1385
Comments
docker exec -it {container name} /surreal sql -c http://localhost:8000 -u root -p root --ns {namespace} --db test --pretty |
I can confirm this issue using a docker-compose file. |
Hi, if it can be useful I launch the database with this docker file configuration: FROM busybox:1.35.0-uclibc as busybox
FROM surrealdb/surrealdb:1.0.0-beta.8
COPY --from=busybox /bin/sh /bin/sh
COPY --from=busybox /bin/mkdir /bin/mkdir
COPY --from=busybox /bin/cat /bin/cat
COPY --from=busybox /bin/chmod /bin/chmod
ENTRYPOINT /surreal start --log debug --user $DB_USER --pass $DB_PASSWORD memory docker-compose.yml version: '3'
services:
db:
env_file:
- ./database/.env
build:
args:
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
context: ./database
dockerfile: Dockerfile
image: db
ports:
- 8000:8000 .env
For further explanation, I borrow from the busibox image the execution requirements that are not in the distroless image. This also allows to run the database as a sh command and to include some environment variables. |
the CLI is part of the surreal binary, so you can execute the command @Franchise-x shared. I assume based on the comments that the real issue is how to connect to a SurrealDB Server running in a container, and for that there are different options:
|
Describe the bug
Hi team,
Based on the documentation it said that the surrealdb's docker image contains fully functional CLI, however, I'm having issues accessing it.
I'm not sure how to access the "surreal" command from my local computer which hosts the docker container, so I tried to sh to the container via the following command:
docker exec -it {{docker_id}} /bin/sh
But I got an error of command not found, so I inspected the image by the following command:
docker inspect surrealdb/surrealdb:latest
And the CMD sections showed null, while it should have /bin/sh, or /bin/bash within it so I can use it to access the DB. I assume it's one of the parts that should be included within the image build?
Any thoughts would be great, if you think I'm missing something, I'm happy to be pointed in the right direction.
Steps to reproduce
Create a fresh surrealdb
docker run --rm --name surrealdb -p 127.0.0.1:8000:8000 surrealdb/surrealdb:latest start --log trace --user root --pass root memory
Try
surreal
from the localhost command line (shouldn't work)SSH to the container
docker exec -it {{docker_id}} /bin/sh
Inspect the image:
docker inspect surrealdb/surrealdb:latest
Expected behaviour
Be able to ssh to the container to use the CLI
SurrealDB version
Release v1.0.0-beta.8
Contact Details
williampham198@gmail.com
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: