This is the alias template I generally use to turn container applications into commandline applications useable in windows terminal contexts.
-
Change the
registry.ioline to what you want to usepodman run --rm -v "%cd%":/bear -w /bear -it docker.io/grafana/grizzly:latest %*
-
(optional) Use the built in user if your container application comes with it
podman run --rm -u user -v "%cd%":/home/user/app -w /home/user/app -it registry.io/application:latest %*
-
Change the name of the file to the cli application like
grr.bat -
Place the file in a folder somewhere like
C:\aliases -
Make sure this folder is in your system path. See this how-to for directions.
- Works in
pwsh,cmd, andvscode/vscodium! - Use cli applications that are not natively built or available for dos!
- Keeps apps up to date with the
latesttag! (Just watch your image count!) - Using the
-iflag you can pipe data into your "fake" application on the command line!
- Scoped to local dir
- App prompt might not work corrctly (you will need to add the
-tflag which might break the-ipipeing)
The main drawback is that you are scoped to the local directory you executed the program in.
This works
C:> podman-application ./local/fileThis won't
C:> podman-application ../../i-can't-reach-above-the-cupboard.txtYou might want to mount a .config folder from your home directory under dos.
You can do so with the %USERPROFILE% variable
-v %USERPROFILE%\.aws:/root/.aws
See this if you have issues with your %USERPROFILE% pointing somewhare else
This is posible for most images. Here I provide steps for Alpine based images.
-
Add your cert chain as seprate
.pemencoded files to aworkdirThis is all the CA Roots and Intermeidiate CAs
can also be formated as a
.crtbundle -
Drop into a alpine terminal while mounting your
workdirC:> podman run -v C:\workdir:/workdir --rm -it alpine:latest -
Copy your cert chain to
/usr/local/share/ca-certificates//> cp /workdir/* /usr/local/share/ca-certificates/
-
Run
update-ca-certificates(8)/> update-ca-certificates -
Retrive the
/etc/ssl/certs/ca-certificates.crt/> cp /etc/ssl/certs/ca-certificates.crt /workdir/ -
Put the
ca-certificates.crtbundle from yourC:\workdirsomewhere on your computer likeC:\containercerts\alpine -
Update your bash alias to mount the certifiacte bundle as RO in your images
-v C:\containercerts\alpine\ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ropodman run --rm -v C:\containercerts\alpine\ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro -v "%cd%":/app -w /app -i registry.io/application:latest %*