Skip to content

Added little options#4

Closed
XV25 wants to merge 14 commits intontorresalberto:mainfrom
XV25:main
Closed

Added little options#4
XV25 wants to merge 14 commits intontorresalberto:mainfrom
XV25:main

Conversation

@XV25
Copy link
Collaborator

@XV25 XV25 commented Feb 4, 2025

While I was trying to add access to a camera inside a container through dogi, I just added three options for the creation of containers (docker run) :

  • One option that let user add "rmw" rules to specific devices (through --device-rmw)

Use case : dogi run ubuntu --device-rmw "81;118"

  • One option to mount specific devices to container (through --device-access)

Use case : dogi run ubuntu --device-access "/dev/video0"

  • Finally, one last option that let user add whatever new commands they may need to their docker run (as I was frustrated not to be able to experiment with docker options using the dogi options as a basis). (through --other)

Use case : dogi run ubuntu --other "--device=/dev/video0"

@ntorresalberto
Copy link
Owner

Happy to see a PR 🥳 , though I haven't taken the time to look at it properly yet.
apt-cacher won't work with non-debian based distros, do you know an alternative?
Also I'm not sure I understand what's the difference between --setup-sudo and --no-user (which allows you to bypass all the user creation/packages setup and just run the container as root.

@XV25
Copy link
Collaborator Author

XV25 commented Feb 21, 2025

apt-cacher won't work with non-debian based distros, do you know an alternative?

I never used a non-debian based distro, so no idea.

Also I'm not sure I understand what's the difference between --setup-sudo and --no-user (which allows you to bypass all the user creation/packages setup and just run the container as root.

Euups, I just hadn't understood the role of the no-user command. My aim was only to offer an option to disable the installation step of the various packages. So, yes, the two options are redundant.

However, the main difference between --setup-sudo and --no-user is that --setup-sudo keeps writing information to the container entrypoint. So, in particular, to keep the nice 🐳 emoji when inside the container.

In this case, I'd suggest :

  • If you want to keep the option to write information to the entrypoint despite using the container as root / not wanting to install the initial packages, keep either --setup-sudo or --no-user.
  • To modify the description of the option kept, to indicate that it allows both to remain root in the container and not to install the initial packages.

XV25 added 4 commits April 3, 2025 14:24
… images (typically, without "/usr/bin" folder; it is the case for "hello-world" image).
…ed as a debugging tool to identity whether there is permission issues with /tmp folder
@XV25
Copy link
Collaborator Author

XV25 commented Apr 4, 2025

Here is a list of the new features implemented:

  • On “dogi run”:

    • “other” option: ability to add a custom string to the “docker run” command. Useful for quickly testing options not implemented by dogi

    • “device-access” option: lets you use docker's “--device” option to mount a set of devices to the container (typically, a camera via /dev/video0)

    • “device-rmw” option: lets you change device access rules (e.g. /dev/video0). In the end, it's not necessary to access a camera (thanks to “device-access”), but I preferred to leave it in case it was needed for an unforeseen use case.

    • setup-sudo" option: has been added to eliminate the apt-get step, and allow dogi to be used without an internet connection. In practice, it is redundant with the “-no-cacher” option. I suggest deleting it, but modifying the “-no-cacher” option so as to be able to keep the dogi icon with this option

    • “temp-dir” option (NEW, WIP): allows you to change the temporary folder, where the temporary files used by dogi are installed. The purpose of this option is to test for a hard-to-identify bug caused by a problem accessing the “/tmp” folder.

    • A message is added when it is not possible to obtain the distro of a docker image. This message is then used to stop image creation. The aim of this feature is to provide an initial condition on the content of an image before it can be created, and to indicate this transparently to the user. Without this feature, the image creation process ends up stopping with a non-transparent error message.

  • In the createUser script: clarification of the reasons for entering the container created via User or via Root.

  • In the readme: some clarifications on the causes of the Dogi bug.

Don't hesitate to tell me which of these options should be kept or removed.

@ntorresalberto
Copy link
Owner

After some cleanup, we'll try to merge this branch that includes most of the changes from this PR: main...PR4

I'm not sure about the following flags in these changes, but we can merge them as is now and think about improvements later. Here are some thoughts for future discussions:

  • --device-rmw: The use-case seems to be to enable access to external memories. Maybe we could automatically detect them and add them as read-only to avoid potential issues and add a new --rw-pendrives for write?
  • --device-access: The use-case seems to be something like --device-access "/dev/video0". I think it could be convenient (though safe is arguable) to detect if there are any cameras and add them automatically. In such case, we could add --no-peripherals to disable them.
  • --temp-dir: use-case seems to be when go is running inside snap and user has no write permissions? Maybe we can use a different dir by default or detect when running in such environment.

@ntorresalberto
Copy link
Owner

Closing this to continue in #5

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