I have a Rails app I’m trying to deploy to Digital Ocean with Kamal 2. I’ve followed all the guides I can find, created a blank droplet with confirmed ssh-key access, made a Docker Registry on D.O. – but I keep hitting this error:
Log into image registry...
INFO [abbc5d4a] Running docker login registry.digitalocean.com -u [REDACTED] -p [REDACTED] as sean@localhost
Finished all in 0.1 seconds
Releasing the deploy lock...
Finished all in 1.7 seconds
ERROR (SSHKit::Command::Failed): docker exit status: 256
docker stdout: Nothing written
docker stderr: flag needs an argument: 'p' in -p
This is my deploy.yaml settings showing the stuff I changed (everything else is defaults)
rails credentials:edit is for secrets to be used in your app. For kamal you will need to .kamal/secrets-common - read more about here Kamal — Environment variables. Once you have that run kamal setup
Hey thanks for your help – I finally figured that out. Strange that Rails’ credentials strategy doesn’t work with Rails’ new deployment strategy. I also found that kamal setup/deploy only uses my .env values if I prefix it like this: dotenv kamal deploy. Not sure why I need to do that when it doesn’t show that in the guides or videos I’ve seen.
That’s not strange at all. Kamal is a deployment tool which should just deploy your app. It shouldn’t depend on your app to be able to boot / read application specific credentials / etc. For example in CI deployment you shouldn’t need to have your app fully setup to be able to deploy.