1

When I run script ("example":"docker ps") via WebStorm run button, I get:

'docker' is not recognized as an internal or external command,
operable program or batch file.

PowerShell script works in Windows 11 terminal.

My aliases for docker:

# powershell
function docker { wsl -- docker $args }
# cmd
@echo off
DOSKEY docker=wsl -- docker $*

enter image description here

How to resolve this problem? I'm using pnpm.

1
  • Just to spell it out: the DOSKEY definition won't work in PowerShell (except if you unload the PSReadLine module, which significantly diminishes the command-line editing experience). For your PowerShell function to be available on startup, you must add it to a/your $PROFILE file (and make sure that PowerShell isn't started with -NoProfile, which seems to be the case). As an aside: For robustness I suggest defining the function as function docker { wsl -e docker $args } Commented Dec 28, 2023 at 14:21

1 Answer 1

0

MacOS solution for podman

  1. create docker file

    sudo nano /usr/local/bin/docker
    
    
  2. add to file

    #!/bin/sh
    exec podman "$@"
    
  3. add perms to run

    sudo chmod +x /usr/local/bin/docker
    
  4. test docker command

    docker ps
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.