I need help on the Docker

Asked

Viewed 45 times

0

Hello, I created my Dockerfile and added some functions, but I need to execute a command inside it and I can’t.

Java CMD -Xmx$SERVER_RAM -Xms$SERVER_RAM -jar $SERVER_JAR nogui (it starts and appears the logs in the docker logs -f) however, when I try to run a command with Docker exec it runs on the system and not on the application, I tried by Docker attach and it opens the server log to type, I tried to use echo "op" | docker attach <container_id> and it does not perform. Someone knows how to execute?

1 answer

1

First your question is very vague, and needs new information about, which image you are using to create the container, is an application, an OS linux(which one) and if it is a version Alpine (which is as clean as possible, if any, may often not have a).

Another solution is to create a container using the command docker exec -it nomeOS <container-ID-or-name> bash.

Another option is to follow the example of this question from Stack in English of which it is very similar to the attach problem.

Browser other questions tagged

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