I'm migrating Docker to Podman and the alias not is working when invoked by npm.
I added on my env alias:
alias docker='podman'
alias docker-compose='podman-compose'
To test the alias I ran docker-compose up --build
and works correctly using podman-compose, like expected.
I have on my package.json:
"scripts": {
"start": "docker-compose up --build",
...
When a I ran npm run start, this is the output:
❯ npm run start
> project@1.0 start
> docker-compose up --build
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I did one more test, change the docker-compose to podman-compose on package.json file and works too.
Expected Behavior
Recognize the env alias. Like happen when I run the command direct on the terminal.
Steps To Reproduce
- Set the podman alias over docker names.
alias docker='podman'
alias docker-compose='podman-compose'
- Add a script on package.json to use the docker-compose.
"scripts": {
"start": "docker-compose up --build",
...
- Run the npm script.
npm run start
Environment
- npm: 8.13.2
- Node.js: v14.19.3
- OS Name: macOS 12.4 (Monterey)
- System Model Name: Macbook Pro M1
- npm config:
❯ npm config ls
; node bin location = /Users/XPTO/.nvm/versions/node/v14.19.3/bin/node
; node version = v14.19.3
; npm local prefix = /Users/XPTO
; npm version = 8.13.2
; cwd = /Users/XPTO
; HOME = /Users/XPTO
; Run `npm config ls -l` to show all defaults.