docker: invalid reference format in shell script

后端 未结 1 1523
天涯浪人
天涯浪人 2020-12-06 21:19

I\'m trying to create a shell script to run a docker container and am struggling. My script is like this:

#!/bin/bash

if [ \"$1\" == \"\" ]; then
    echo \         


        
相关标签:
1条回答
  • 2020-12-06 21:43
    docker run \
    -e NODE_PATH='./src' \
    -e NODE_HOST='0.0.0.0' \
    -e NODE_ENV='production' \
    -e DOCKER=true \
    -e PORT='8080' \
    -e STAGING=true \
    -e SENDGRID_API_KEY='<redacted>' \
    -p 8080:8080 --rm -it $1
    

    The image name should be after the -it parameter and so re arrange your run command.

    0 讨论(0)
提交回复
热议问题