Docker Community Forums

Share and learn in the Docker community.

How to run script inside container with docker swarm

Hello everyone!

I am having some problems when using docker swarm to deploy container in worker node. I have 2 options to do

Option 1: I will use Dockerfile to build image in manager node.
Option 2: I will build image, and then push into docker hub, and use this image to deploy container in worker node.

Both of them are faild!

Because in Dockerfile, I run script containing some env variables. Anyone can give me an advice to solve this problem? Thanks!