docker-stress
docker-stress copied to clipboard
Docker compose use
Hi, how do i pass args (e.g. --cpu 2 --io 1) in a docker-compose.yml ?
version: '2' services: app01: image: progrium/stress cpu: 2 io: 1 vm: 2 vm-bytes: 128M timeout: 10s
this is what i've done, but it doesnt work, help me please.
I think you could use command: https://docs.docker.com/compose/compose-file/#command
Although you may have to also pass the entrypoint, e.gL
services:
foo:
command: /usr/bin/stress --verbose --cpu 2
I haven't tried this though :)
There's a few gotchas here:
commandhas to be an array of arguments- arguments are appended to the entrypoint, so you don't need to specify that
- arguments have to be strings, so you have to quote numbers:
# docker-compose.yaml
version: '3'
services:
stress:
image: progrium/stress
command: [--cpu, "2"]