Comments (4)
I also tried adding the -p ..
parameter to docker-rootless.sh directly instead of going through the DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS
variable. A few other different approaches to escape/mask the space did not work as well.
from ansible-role-docker-rootless.
Hi @monsdar, I haven't tried exposing the port, but I'll have a look later tonight
from ansible-role-docker-rootless.
Let me know if I can provide any more info or if there is anything I can test out on my end.
from ansible-role-docker-rootless.
I cheated a bit and used port 2375 to skip the cert generation.
First update the docker.service
for the Docker user and then restart the service.
~$ grep 2375 ~/.config/systemd/user/docker.service
Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS=-p 0.0.0.0:2375:2375/tcp"
ExecStart=/home/dockeruser/bin/dockerd-rootless.sh -H tcp://0.0.0.0:2375 -H unix:///run/user/1001/docker.sock
~$ XDG_RUNTIME_DIR="/run/user/1001" DOCKER_HOST="unix:///run/user/1001/docker.sock" systemctl --user daemon-reload
~$ XDG_RUNTIME_DIR="/run/user/1001" DOCKER_HOST="unix:///run/user/1001/docker.sock" systemctl restart --user docker
~$ sudo ss -ltnap
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=736,fd=3))
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=650,fd=13))
ESTAB 0 0 10.0.2.15:22 10.0.2.2:50352 users:(("sshd",pid=1970,fd=4),("sshd",pid=1922,fd=4))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=736,fd=4))
LISTEN 0 4096 *:2375 *:* users:(("rootlesskit",pid=2405,fd=9))
The log will notify you about the bad choice of configuration.
[DEPRECATION NOTICE]: API is accessible on http://0.0.0.0:2375 without encryption...
As another user, copy the docker
binary, unalias docker
, and then export DOCKER_HOST
.
~$ sudo cp /home/dockeruser/bin/docker .
~$ unalias docker
~$ DOCKER_HOST=tcp://127.0.0.1:2375 ./docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3d4a6390e8df konstruktoid/nginx "/usr/sbin/nginx -g …" 40 minutes ago Exited (0) 22 minutes ago nginxport
eced319b8a6e konstruktoid/nginx "/usr/sbin/nginx -g …" 41 minutes ago Exited (0) 22 minutes ago nginx
~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:c1:34:b9 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
valid_lft 83818sec preferred_lft 83818sec
inet6 fe80::a00:27ff:fec1:34b9/64 scope link
valid_lft forever preferred_lft forever
~$ DOCKER_HOST=tcp://10.0.2.15:2375 ./docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3d4a6390e8df konstruktoid/nginx "/usr/sbin/nginx -g …" 41 minutes ago Exited (0) 23 minutes ago nginxport
eced319b8a6e konstruktoid/nginx "/usr/sbin/nginx -g …" 41 minutes ago Exited (0) 23 minutes ago nginx
from ansible-role-docker-rootless.
Related Issues (20)
- Update to Docker 23.0.4
- .bashrc generation tasks problem HOT 7
- adding skip_service_restart conditional check to skip docker service restart HOT 9
- Allowing Docker compose installation for Almalinux HOT 2
- Use pipx HOT 1
- Use 'docker compose' command (without hiphen) HOT 11
- The conditional check 'not docker_user_bashrc.stat.exists' failed. The error was: error while evaluating conditional HOT 2
- bump Docker to 23.0.7 HOT 1
- Add daemon.json config HOT 13
- Unable to deploy container HOT 8
- docker_user = ansible_user HOT 5
- Variable COMPOSE_PLUGIN_PATH not set in bash_completion.d/docker script HOT 2
- Containers are fine, however docker-compose does not work for ansible HOT 4
- .bash_aliases and .bashrc are created in wrong user's directory HOT 5
- Docker compose is hardcoded for x86_64 HOT 3
- Can support for Amazon Linux 2 be added? HOT 6
- Documentation branch HOT 1
- Error running hello-world on Raspberry PI 4 running raspbian OS HOT 4
- Error accessing mounted directories using a non-root container user. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-docker-rootless.