Skip to content

Commit

Permalink
Fix: Docker Compose compatibility with v1 removal (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
xnox authored Mar 30, 2023
1 parent 6c94d21 commit ac3f6ca
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions providers/docker/units/docker.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ command:
export -n PYTHONHOME PYTHONUSERBASE PYTHONPATH
set -e
compose_file={root_dir}/docker-compose.yaml
echo "test:
image: ubuntu
command: bash
tty: true" > $compose_file
echo "version: '2'
services:
test:
image: ubuntu
command: bash
tty: true" > $compose_file
{compose_command} -f $compose_file up -d
ID=$({compose_command} -f $compose_file ps -q test)
[ `docker inspect -f {status} $ID` != running ] && exit 1
Expand All @@ -274,10 +276,12 @@ command:
set -e
#read content from stdin
yml=$(cat <<EOF
test:
image: ubuntu
command: bash
tty: true
version: '2'
services:
test:
image: ubuntu
command: bash
tty: true
EOF
)
echo "$yml" | {compose_command} -f - pull
Expand Down Expand Up @@ -413,10 +417,12 @@ command:
export -n PYTHONHOME PYTHONUSERBASE PYTHONPATH
set -e
compose_file={root_dir}/docker-compose.yaml
echo "test:
image: ubuntu
command: sleep 1
restart: always" > $compose_file
echo "version: '2'
services:
test:
image: ubuntu
command: sleep 1
restart: always" > $compose_file
{compose_command} -f $compose_file up -d
ID=$({compose_command} -f $compose_file ps -q test)
restartPolicy=$(docker inspect -f {restartPolicy} $ID)
Expand Down

0 comments on commit ac3f6ca

Please sign in to comment.