Skip to content
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

refactor: logic in docker environment #917

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lvillis
Copy link

@lvillis lvillis commented Oct 27, 2023

The judgment of docker containers can be more elegant, and the judgment of podman and k8s runtime can be added in the future.

@Eugeny
Copy link
Member

Eugeny commented Oct 27, 2023

Thank you for the contribution but /.dockerenv doesn't actually exist in the image

@lvillis
Copy link
Author

lvillis commented Oct 28, 2023

Thank you for the contribution but /.dockerenv doesn't actually exist in the image

I tested it and found that .dockerenv exists in the root directory during runtime and setup. This method is reliable.

image
image

@Eugeny
Copy link
Member

Eugeny commented Nov 3, 2023

Not sure if it's your Docker configuration or something else, but the images built by CI from the main branch don't have that file:

❯ docker run --platform linux/amd64 --rm --entrypoint ls ghcr.io/warp-tech/warpgate:main  -la /
total 76
drwxr-xr-x   1 root root 4096 Nov  3 21:18 .
drwxr-xr-x   1 root root 4096 Nov  3 21:18 ..
drwxr-xr-x   2 root root 4096 Oct 24  2022 bin
drwxr-xr-x   2 root root 4096 Sep  3  2022 boot
drwxr-xr-x   2 root root 4096 Nov  3 21:18 data
drwxr-xr-x   5 root root  340 Nov  3 21:18 dev
drwxr-xr-x   1 root root 4096 Nov  3 21:18 etc
drwxr-xr-x   2 root root 4096 Sep  3  2022 home
drwxr-xr-x   8 root root 4096 Oct 24  2022 lib
drwxr-xr-x   2 root root 4096 Oct 24  2022 lib64
drwxr-xr-x   2 root root 4096 Oct 24  2022 media
drwxr-xr-x   2 root root 4096 Oct 24  2022 mnt
drwxr-xr-x   2 root root 4096 Oct 24  2022 opt
dr-xr-xr-x 321 root root    0 Nov  3 21:18 proc
drwx------   2 root root 4096 Oct 24  2022 root
drwxr-xr-x   3 root root 4096 Oct 24  2022 run
drwxr-xr-x   2 root root 4096 Oct 24  2022 sbin
drwxr-xr-x   2 root root 4096 Oct 24  2022 srv
dr-xr-xr-x  13 root root    0 Nov  3 21:18 sys
drwxrwxrwt   2 root root 4096 Oct 24  2022 tmp
drwxr-xr-x   1 root root 4096 Oct 24  2022 usr
drwxr-xr-x   1 root root 4096 Oct 24  2022 var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants