0

I have a docker run command but it fails to run using docker run. However it run fine when we login to docker and running the command seprately

docker run --rm $image argocd app patch myapplication --patch='[{"op": "replace", "path": "/spec/source/path", "value": "newPath"}]' --type json


.......
Usage:
  argocd app patch APPNAME [flags]

same command when running inside containers works ok. could be some problem with the quotes, I am not sure. any help appreciated.

its a bit complicated with single and double quote together

user2511126
  • 620
  • 1
  • 14
  • 31
  • You should put the command you want to run in a variable and pass the variable to docker run. See https://stackoverflow.com/questions/39443913/passing-a-command-with-arguments-as-a-string-to-docker-run – TGN12 Jun 15 '20 at 04:18
  • I followed that but doesnt seems to work in the right way – user2511126 Jun 15 '20 at 04:30

1 Answers1

0

You can try to escape your double quotes

docker run --rm $image argocd app patch myapplication --patch='[{\"op\": \"replace\", \"path\": \"/spec/source/path\", \"value\": \"newPath\"}]' --type json