I'm starting a debian jessie container from jessie like this:
systemd-nspawn --network-macvlan=eth0 -b -j -D /var/lib/container/debsid
The container get's an IPv4 from the gateway via DHCP, that's fine and also reaches servers outside. But I can't connect to the host and from the host the container's IP is not reachable. Any ideas on what is going wrong and which steps are missing?
(container created with debootstrap, just networkd is added to set the IP via DHCP)
You'll need to create a macvlan on the parent machine to allow for connectivity to the macvlans in your nspawn guests.
Take a look at the instructions here. http://web.archive.org/web/20190917181922/http://noyaudolive.net/2012/05/09/lxc-and-macvlan-host-to-guest-connection/
Related
I'm running a private container registry on my docker host. The same docker host is running Portainer and I would really like to keep using Portainer to manage my docker host.
But since I'm running a private container registry its only set up with http, and I need to configure the container client do allow http.
I've tried opening console on Portainer on the running Portainer container but It only "refreshes" the window.
I've puttyied in and tried to attach to the container but this only crashes the container.
Any clue on how to access the /etc/docker/daemon.json resource in the portainer instance?
Portainer interacts with the host's docker daemon, so edit (or create) the /etc/docker/daemon.json file on the host
I'm currently using containerd to run my application container for testing, but having a problem with networking.
I need to send some requests to port 5000 of my application container though there's no description on ctr manual about running a container with port forwarding.
Using docker, we can do like as follows:
docker run test-image -d -p 5000:5000
Can I do the same thing using ctr command?
I know nerdctl can do this but it's hard to use this tool for some reasons within my company.
ctr cannot, but you can download nerdctl and that will do it.
No, ctr is not a comprehensive tool and it does not support all the commands that docker cli used to support.
There is no command in ctr for port forwarding.
I have created two docker containers, One is mysql and other is phabricator both are linked and both are locally. I have bound mysql port to 0.0.0.0. Now I want to expose the phabricator to internet. so that everyone can use that. --net=host option does not work with links. Can anyone tell me how can I achieve this ?
You need to start your phabricator container with -p setting which defines the port mapping- Let's say your container internally exposes port 8080, then you can define it like -p 8080:8080, which means that the port 8080 is also externally accessible (as long as your host is reachable from internet on port 8080 without interfering firewall).
I built a mysql docker container. It seems to work fine, however when I try to connect to it from a computer it wont connect to mysql. The computer is in the same lan and can connect via ssh so it's not a networking issue. I'm pretty sure it has something to do with the ports not being published or binded correctly. Any suggestions? Thank you!
The most likely suspects for your issue are:
Your host firewall is set to not allow connections to MySQL (port 3306). It may be published by docker but you aren't permitting connections from outside the host.
Your docker isn't publishing as part of the same network but rather as a sub-network (not likely since you can connect to ssh from the other computer)
Your mysql instance is not set up to listen to remote connections. Check your my.cnf to ensure that it is isn't listening to localhost:3306.
hi I have a mysql container running as a service, and for other services connect it with a jdbc url, with a ip:port.
and for sometimes the server needs to reboot. and the ip addr of mysql container will change, for every service needs to connect to mysql, the jdbc url needs to be modified.
is there a way to 'docker start' a container with a fixed ip address?
I've tried --ip but it's not working
docker version 1.11.2
You can preset an IP to a container, but this must be done when you create the container (in the docker run).
https://docs.docker.com/engine/reference/run/
To preset an IP to a container you ahve to add the switch --ip="desired_ip_here" in the docker run
Also you can use tools like supervisord to manage you processes and restart services without stopping the container.