I am using golang:1.14.7-alpine to build and run a test go application. I have the docker-compose file with “command:” line but I can only run one command. How can I run two or more commands?
Thanks.
Share and learn in the Docker community.
I am using golang:1.14.7-alpine to build and run a test go application. I have the docker-compose file with “command:” line but I can only run one command. How can I run two or more commands?
Thanks.
You can use an entrypoint script.
entrypoint: /code/entrypoint.sh
A similar command is available in the Dockerfile.
What would that .sh file look like? For instance, so I want to run:
go version
go run .
It is just a shell script where you put all the commands that you want to execute.