Hot answers tagged

36 votes
Accepted

Ansible: Other option available for telnet check of open ports?

You can use the Ansible wait_for module which checks a specific TCP port is open. Since in this case, all ports should be open already, we can use a minimal no. of retries, just enough to cover ...
RichVel's user avatar
  • 892
32 votes
Accepted

Why use EXPOSE in Dockerfile -- since you can bind to all ports anyways

Docker's EXPOSE documentation addresses this specific point: The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the ...
Tensibai's user avatar
  • 11.3k
5 votes

Why use EXPOSE in Dockerfile -- since you can bind to all ports anyways

This is done for automation sake. You can have a universal command that runs docker run -P to start a container and the Dockerfile itself is used to specify which container exposes which port. In case ...
Jiri Klouda's user avatar
  • 5,807
5 votes

How to deterministic and reproducibly assign increasing port numbers in Ansible?

Disclaimer: I'm not using Ansible. What I would do is use a random "predictable" number. According to Ansible doc you can seed the random number generator: As of Ansible version 2.3, it’s also ...
Tensibai's user avatar
  • 11.3k
3 votes

Why is ansible not sending the correct sudo password?

The cure (or bandaid) was to set Pipelining=False in the ansible.cfg file. This kind of stinks because I like Pipelining and it works, but I guess ansible is gonna treat that first ssh statement as ...
Peter Turner's user avatar
  • 1,441
3 votes
Accepted

Why won't InSpec admit that port 5432 is listening inside a PostgreSQL container?

You did everything right, it is the correct InSpec test and use with Docker! You encountered a bug in InSpec that is related to InSpec's netstat output parsing combination with Alpine's netstat ...
Christoph Hartmann's user avatar
2 votes
Accepted

Docker not exposing port on mojave mac

Most likely the port is published on the VM and you are trying to connect to your laptop's IP and not seeing it. Newer versions of docker that use xhyve include some networking tricks to publish the ...
BMitch's user avatar
  • 3,280
2 votes

Ansible: Other option available for telnet check of open ports?

AFAIK there is no built-in module for this purpose, but you can use shell + nc: --- - hosts: all tasks: - shell: nc -z -w 1 -G 1 my.hostname.com {{ item }} || echo "Port {{ item }} is closed" ...
Konstantin Suvorov's user avatar
2 votes

How to modify/allow firewall rules of a GCP instance directly from the CLI?

Most probably, you are using the wrong account. Find out which one you are currently using in CLI: gcloud config configurations list gcloud auth list If the selected configuration is wrong, fix it ...
xy2's user avatar
  • 181
2 votes

How can I expose port 3389 using a secure approach

You can add, if it's not already the case, a frontal, rev proxy, to prevent direct access to the TS. This could also add an authentication layer... I am not a lot in Microsoft stuff so this is really ...
Pier's user avatar
  • 344
2 votes

Why do I get different responses either when I use `sudo` before `kubectl` or not?

I think you haven't configured kubeconfig in root user. The sudo command allows you to run programs with the security privileges of another user. When you run sudo kubectl you're running kubectl with ...
sujit patel's user avatar
1 vote
Accepted

What is this "rootlessport", and how to get it to release the port hold?

I found that rootlessport is part of the podman package. I was able to kill the process as root: kill $( ps aux | grep rootlessport ) After that, the port was released, and I could spin up new ...
Polo's user avatar
  • 21
1 vote
Accepted

Why does running a nginx image in docker interactive mode makes nginx not working

Basically, containers can only run a single process. When you run: docker run -d --name nginx1 -p 49699:80 nginx The container will start by running its CMD. If we look at the Dockerfile for the ...
Levi's user avatar
  • 1,034
1 vote

What is the best way to reverse port forward information from a Kubernetes cluster to localhost?

If you have access to kubectl, try kubectl port-forward service/<servicename> 8000:30085.
benjimin's user avatar
  • 279
1 vote

Why does the Rancher Security Group use TCP Port 10256?

According to this page it is used for kubeproxy. The Kubernetes network proxy runs on each node. This reflects services as defined in the Kubernetes API on each node and can do simple TCP, UDP, and ...
kenlukas's user avatar
  • 674
1 vote

Is there a way to map ports two docker container

On Linux, containers live in separate network namespaces, so localhost or 127.0.0.1 on the container is not localhost on the host. I'm not sure about other OSes. You could expose a port to the host ...
Dagelf's user avatar
  • 141
1 vote

Docker: Let containers communicate to each other but don't expose to internet

When you use network_mode host, the published ports are ignored, which means the ports that are open in the containers will be the same port in the host. Does not matter what you had declared in ports ...
Joao  Vitorino's user avatar
1 vote
Accepted

how to connect to a MySQL database in a docker container?

One way to achieve this is by using the MySQL socket to connect instead of port. For this you would have bind a mount to your container. You would anyway need a host directory bound to container to ...
seshadri_c's user avatar
1 vote

How do I make a redis container accessible through bridge networking from the host?

By default Docker uses the bridge network. On a default Docker installation you can simply map a port to the container's service port. The Redis Docker image exposes its service on port 6379 so you ...
swysocki's user avatar
  • 808
1 vote
Accepted

What can I use to forward a conection to port 3006 on the bastion to an RDS database?

It is possible on the Linux(Unix) bastion host. Step-1: First ssh to the bastion host. eg. 16.23.14.20 is the bastion host. # ssh [email protected] Step-2: Create port tunneling by using the below ...
Arvind Rawat's user avatar
1 vote

Docker bridge network Configuration for containers

Since you are using the tag "Docker-Machine" I'm assuming that you are using Docker Toolbox to manage Docker. The problem is most likely an issue with Virtual Box configuration than your Docker ...
Wesley Rolnick's user avatar
1 vote
Accepted

Running services on different ports in development environment and production environment

This should be fine. It's something you may even have to do if ports are already in use on localhost. Even development languages like .net core are now supporting different environments that can be ...
Wesley Rolnick's user avatar
1 vote
Accepted

When would I choose IPTables over an Ambassador pattern for port forwarding?

iptables will probably scale better than socat because socat runs completely in user space. There's a common impression that iptables is hard to deal with, but I find it easier that most routers to ...
chicks's user avatar
  • 1,838

Only top scored, non community-wiki answers of a minimum length are eligible