Comments (9)
it's now much easier to add more commands using @cmd_run(podman_compose, cmd_name, cmd_desc)
see CONTRIBUTING.md
from podman-compose.
@stefanb2 there are some missing features like passing custom -l
and -e
and -v
.
please test
$ python3 podman-compose.py -f examples/busybox/docker-compose.yaml run -h
usage: podman-compose.py run [-h] [-d] [--name NAME] [--entrypoint ENTRYPOINT]
[-e KEY=VAL] [-l KEY=VAL] [-u USER] [--no-deps]
[--rm] [-p PUBLISH] [--service-ports] [-v VOLUME]
[-T] [-w WORKDIR]
service ...
create a container similar to a service to run a one-off command
positional arguments:
service service name
command comman and its args
optional arguments:
-h, --help show this help message and exit
-d, --detach Detached mode: Run container in the background, print
new container name.
--name NAME Assign a name to the container
--entrypoint ENTRYPOINT
Override the entrypoint of the image.
-e KEY=VAL Set an environment variable (can be used multiple
times)
-l KEY=VAL, --label KEY=VAL
Add or override a label (can be used multiple times)
-u USER, --user USER Run as specified username or uid
--no-deps Don't start linked services
--rm Remove container after run. Ignored in detached mode.
-p PUBLISH, --publish PUBLISH
Publish a container's port(s) to the host (can be used
multiple times)
--service-ports Run command with the service's ports enabled and
mapped to the host.
-v VOLUME, --volume VOLUME
Bind mount a volume (can be used multiple times)
-T Disable pseudo-tty allocation. By default `podman-
compose run` allocates a TTY.
-w WORKDIR, --workdir WORKDIR
Working directory inside the container
$ python3 podman-compose.py -f examples/busybox/docker-compose.yaml run --rm redis /bin/sh -c 'cat /etc/passwd'
# podman run --rm -i --name=busybox_redis_tmp60155 --pod=busybox ...
root:x:0:0:root:/root:/bin/ash
bin:x:1:1:bin:/bin:/sbin/nologin
...
redis:x:999:1000:Linux User,,,:/home/redis:/sbin/nologin
0
if it's not detached I make it interactive so you can run /bin/sh
please tell me if this behaviour is correct
from podman-compose.
Looks like you beat me to the punch. I started to work on an implementation yesterday. Unfortunately your changes seem to have broken the script completely.
If I take HEAD (7e0a036) I can't get podman-compose.py run XXX
to work at all: the command parser sees XXX
as the command instead of run
. If I checkout HEAD^ (eb72a71) then it seems podman-compose.py run XXX
does what it is supposed to do.
But commit eb72a71 broke podman-compose.py -t identity up
completely, so I can't really test your changes:
File ".../podman-compose.py", line 364, in mount_desc_to_args
mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, srv_name, cnt_name))
File ".../podman-compose.py", line 334, in mount_dict_vol_to_bind
proj_name = compose.proj_name
AttributeError: 'PodmanCompose' object has no attribute 'proj_name'
Looks like a typo and that line should instead read:
proj_name = compose.project_name
from podman-compose.
Looks like a typo and that line should instead read:
yes, I've fixed that typo.
from podman-compose.
I got this working, but only with #43
from podman-compose.
This works for me on master, but one note, it always tries to re-create the pod:
✸ docker-compose run app /bin/bash
podman pod create --name=search --share net -p 8000:8000
Error: unable to create pod: error adding pod to state: name search is in use: pod already exists
125
...snip...
root@6bed1a5d3f2d:/app# exit
from podman-compose.
Would this make exec
easier to implement or would that need a separate implementation?
from podman-compose.
Got a prob with the run command
#!/bin/sh -x
#/entrypoint.sh
echo "$@"
exit 1
$ podman-compose run app foo bar
+ echo
+ exit 1
It seems my args are not passed to the entrypoint.
Is it a bug? Have I missed something?
from podman-compose.
I'll try to look at issue this weekend.
from podman-compose.
Related Issues (20)
- Add TOML support for Podman-Compose? HOT 3
- RuntimeError: volume not defined in top level
- DNS not working anymore on Fedora 40/Podman 5.0 HOT 2
- Multi-line environment files are not correctly processed HOT 1
- Get command without docker-compose labels? HOT 4
- links: with dns name don't seem to work
- FR: Enabling GPU access to service containers
- Podman Compose 1.1.0 fails non-deterministically to start a system with multiple dependencies HOT 1
- Registering a systemd unit should not create pods or containers
- How to install podman-compose in an air-gapped network? HOT 6
- bump podman-compose version to 1.1.1 or 1.2.0 HOT 1
- Broken support for Containerfile
- Building or Running a Service Fails Without Explicit Profile
- Environment variables defined in compose file are included in image build
- Upgrade `podman-compose` to the latest version in pip and Homebrew HOT 1
- Unable to start containers with userns on v1.1.0 HOT 2
- podman multiple erros starting container HOT 1
- podman-compose 1.1.0 no longer loads env file in the same directory with compose.yaml when using `-f` HOT 1
- Podman-compose mount volume incorrectly under Windows with podman machine on WSL
- Required variable syntax ("${BAR:?BAR variable missing}") not resolved when not in quotation marks since v1.1.0 (in command)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podman-compose.