mirror of
https://github.com/containers/podman-compose.git
synced 2025-02-02 11:29:56 +01:00
test compose files with build
This commit is contained in:
parent
7bc6782e0d
commit
be2726da18
25
tests/build/README.md
Normal file
25
tests/build/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Test podman-compose with build
|
||||
|
||||
```
|
||||
podman-compose build
|
||||
podman-compose up -d
|
||||
curl http://localhost:8080/index.txt
|
||||
curl http://localhost:8000/index.txt
|
||||
podman inspect my-busybox-httpd2
|
||||
podman-compose down
|
||||
```
|
||||
|
||||
expected output would be something like
|
||||
|
||||
```
|
||||
2019-09-03T15:16:38+0000
|
||||
ALT buildno=2 port 8000 2019-09-03T15:16:38+0000
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
as you can see we were able to override buildno to be 2 instead of 1,
|
||||
and httpd_port to 8000.
|
||||
|
||||
NOTE: build labels are not passed to `podman build`
|
3
tests/build/context/Dockerfile
Normal file
3
tests/build/context/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM busybox
|
||||
RUN mkdir -p /var/www/html/ && date -Iseconds > /var/www/html/index.txt
|
||||
CMD ["busybox", "httpd", "-f", "-p", "80", "-h", "/var/www/html"]
|
7
tests/build/context/Dockerfile-alt
Normal file
7
tests/build/context/Dockerfile-alt
Normal file
@ -0,0 +1,7 @@
|
||||
FROM busybox
|
||||
ARG buildno=1
|
||||
ARG httpd_port=80
|
||||
ENV httpd_port ${httpd_port}
|
||||
RUN mkdir -p /var/www/html/ && \
|
||||
echo "ALT buildno=$buildno port=$httpd_port `date -Iseconds`" > /var/www/html/index.txt
|
||||
CMD httpd -f -p "$httpd_port" -h /var/www/html
|
19
tests/build/docker-compose.yml
Normal file
19
tests/build/docker-compose.yml
Normal file
@ -0,0 +1,19 @@
|
||||
version: "3"
|
||||
services:
|
||||
web1:
|
||||
build: ./context
|
||||
image: my-busybox-httpd
|
||||
ports:
|
||||
- 8080:80
|
||||
web2:
|
||||
build:
|
||||
context: ./context
|
||||
dockerfile: Dockerfile-alt
|
||||
labels:
|
||||
mykey: myval
|
||||
args:
|
||||
buildno: 2
|
||||
httpd_port: 8000
|
||||
image: my-busybox-httpd2
|
||||
ports:
|
||||
- 8000:8000
|
Loading…
Reference in New Issue
Block a user