loading...

Discussion on: Deploy a React app to DigitalOcean using Github Actions and Docker

Collapse
christianmontero profile image
Christian Montero

I' m getting an error in the deploy stage, this is the output:

======CMD======
docker stop $(docker ps -a -q)
docker login docker.pkg.github.com -u $GITHUB_USERNAME -p $GITHUB_TOKEN
docker pull docker.pkg.github.com/fredomontero/bones/bones:latest
docker run -dit -p 3001:80 docker.pkg.github.com/fredomontero/bones/bones:latest
======END======
err: bash: line 2: docker: command not found
err: bash: line 2: docker: command not found
err: bash: line 3: docker: command not found
err: bash: line 4: docker: command not found

does anybody knows what' s wrong?

Collapse
kenessajr profile image
Remy Muhire Author

Hi Christian, can you check if you have docker installed on your production server?

Collapse
christianmontero profile image
Christian Montero

Hi Remy, thanks for answering I already solved, the issue was that I installed docker using snap, and reading on the web I realized that snap installs everything under /snap and that is not part of the environment variable PATH.

it was a little tricky because if I ssh from my local computer to the server and then run docker it works, but it didn't work from the yml file.

so instead of running docker I had to run /snap/bin/docker

or create a symlink:

sudo ln -s /snap/bin/docker /usr/bin/docker

Thank for this post bro it's very helpful!