How to Run Docker with Current Host User, When Users Are Managed with Linux Nis (Network Information Service)

Docker nginx php permissions issue

Consider running docker with your current host user.
Here are some links that you can take a look at.:

How to run docker with current host user, when users are managed with Linux NIS (Network Information Service)
Running as a host user within a Docker container
https://jtreminio.com/blog/running-docker-containers-as-current-host-user/

How to Pass-through Physical NIC to Docker Container?

It is posible to move network interface to the container NET NAMESPACE (example based on my experience moving SR-IOV VF interfaces to container):

HOST_INTERFACE=enp4s6f5
CONT_IFACE_NAME=eth255
container=debian-test

NSPID=$(docker inspect --format='{{ .State.Pid }}' $container

ip link set "$HOST_IFACE" netns "$NSPID"

in case when interface name matters it is possible to change it before set UP

ip netns exec "$NSPID" ip link set "$HOST_IFACE" name "$CONT_IFACE_NAME"

set it up

ip netns exec "$NSPID" ip link set "$CONT_IFACE_NAME" up

Jenkins store workspace outside docker container

Ok, so the way I've solved this problem was to mount a dir on the container from the slave docker container, then using NFS (Instructions are shown below) I've mounted the that slave docker container onto jenkins master.

So my config looks like this:

Sample Image

I followed this answer to mount dir as NFS:

https://superuser.com/questions/300662/how-to-mount-a-folder-from-a-linux-machine-on-another-linux-machine/300703#300703

One small note is that the ip address that's provided in that answer (that you will have to put in the /etc/exports) is the local machine (or in my case the jenkins master) ip address.

I hope this answer helps you out!

Cannot set Traefik via labels inside docker-compose.yml

It's possible to use:

volumes:
- /var/run/docker.sock:/var/run/docker.sock

Only with this workaround in Powershell:

$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1

The reason is this opened bug: https://github.com/docker/for-win/issues/1829
which makes it impossible to mount docker.sock, because it is "not a valid Windows path" (error).

c++ qualifier error

In your operator= function, inNode is constant. The function getID is not constant, so calling it is discarding the constness of inNode. Just make getID const:

luint getID() const { return this->ID; }

Mounts denied. The paths ... are not shared from OS X and are not known to Docker

Docker for Mac volume mounts behave differently than the base Docker system. This is mostly because Docker tries to comply with Apple's filesystem sandbox guidelines.

As shown in Docker's preferences, only certain paths are exported by macOS.

  • /Users
  • /Volumes
  • /tmp
  • /private

File Sharing preference panel

/var in macOS is a symbolic link into /private. That is also true for /tmp:

$ ls -ld /tmp /var
lrwxr-xr-x@ 1 root wheel 11 Jan 26 16:18 /tmp -> private/tmp
lrwxr-xr-x@ 1 root wheel 11 Jan 26 16:18 /var -> private/var

Why is /tmp listed in the sharing panel, but /var is not (even though both are a part of /private)? Docker for Mac's documentation about filesystem namespaces explains:

By default, you can share files in /Users/, /Volumes/, /private/, and /tmp directly. To add or remove directory trees that are exported to Docker, use the File sharing tab in Docker preferences whale
menu -> Preferences -> File sharing. (See Preferences.)

All other paths used in -v bind mounts are sourced from the Moby Linux VM running the Docker containers, so arguments such as -v /var/run/docker.sock:/var/run/docker.sock should work as expected. If a macOS path is not shared and does not exist in the VM, an attempt to bind mount it will fail rather than create it in the VM. Paths that already exist in the VM and contain files are reserved by Docker and cannot be exported from macOS.

Note that /var/run is specifically mentioned here as a place that would be mounted from the Linux VM, instead of from macOS.

When you ask for a volume mount, macOS filesystem exports are checked first. If there is no match there, the Linux VM where Docker is running is checked next. If neither of them have the path you requested, then the mount fails.

In your case, /var is not exported by macOS. /var exists in the Linux VM, but /var/folders does not. Therefore, the path is not available, and the mount fails.

If you change the path to /private/var, then it will succeed, because macOS exports the entire /private filesystem tree for mounting.

In order to make things more portable, you may want to test which platform you are currently running on, and if it's macOS, prefix the mount path with /private.



Related Topics



Leave a reply



Submit