HOW TO RUN AN APP WITH DOCKER

Asked

Viewed 1,023 times

-2

Eai my consecrated men!!

I created two containers running linux and I’m trying to communicate between two containers. I want to exchange messages between these containers through Python and Java applications. One of these languages to implement the client and the other to the server.

How do I run an application in these containers?

How I communicate using an application.

Note: The application I am using is a simple code that asks for a number and digit.

1 answer

0

How do I run an application in these containers?

In a rough way you should enter the container and install the program, it helps if you have created a volume or a sharing point when creating the containers. You can access the containers with the command:

docker exec -ti nome-do-container /bin/bash

This will give you access to the container terminal. Then just install the program.

Documentation Docker exec

Note: This form is not the most suitable to run a program inside a container, the ideal would be to use a entrypoint.

Good practice on Ocker

How I communicate using an application.

You must expose the container server port at the time of its creation with the --Publish or -p option, so it is accessible to the other container.

Documentation Docker run

  • Could I contact you for further help? Of course, if you have time available.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.