Open cubesky opened 9 months ago
After changing Detach to true here, deploy works for podman, but i don't have docker installed to test.
After changing Detach to true here, deploy works for podman, but i don't have docker installed to test.
i had test this and it works well:
[Fri Aug 2 14:37:01 CST 2024] The domain 'www.example.com' seems to already have an ECC cert, let's use it.
[Fri Aug 2 14:37:02 CST 2024] Container id: 38471aad49dc030f5e374f38ea3a4045a3300f5fc0e706bf354aecb0cb5f5239
[Fri Aug 2 14:37:02 CST 2024] Copying file from /acme.sh/www.example.com_ecc/www.example.com.key to /etc/nginx/ssl/www.example.com/key.pem
[Fri Aug 2 14:37:02 CST 2024] Copying file from /acme.sh/www.example.com_ecc/www.example.com.cer to /etc/nginx/ssl/www.example.com/cert.pem
[Fri Aug 2 14:37:02 CST 2024] Copying file from /acme.sh/www.example.com_ecc/ca.cer to /etc/nginx/ssl/www.example.com/ca.pem
[Fri Aug 2 14:37:02 CST 2024] Copying file from /acme.sh/www.example.com_ecc/fullchain.cer to /etc/nginx/ssl/www.example.com/full.pem
[Fri Aug 2 14:37:02 CST 2024] Reloading: nginx -s reload
[Fri Aug 2 14:37:02 CST 2024] Success
and my podman paramters:
#!/bin/sh
podman pod create \
--name webapp \
--hostname webapp \
--network slirp4netns:port_handler=slirp4netns \
--publish 80:80 \
--publish 443:443 \
--replace
podman pod start webapp
podman create \
--name nginx \
--pod webapp \
--systemd false \
--label app=nginx \
--volume /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro \
--volume /root/webapp/data/nginx/www/:/usr/share/nginx/html:ro \
--volume /root/webapp/data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
--volume /root/webapp/data/nginx/ssl.conf:/etc/nginx/ssl.conf:ro \
--volume /root/webapp/data/nginx/proxy.conf:/etc/nginx/proxy.conf:ro \
--volume /root/webapp/data/nginx/error_pages.conf:/etc/nginx/error_pages.conf:ro \
--volume /root/webapp/data/nginx/dhparams.pem:/etc/nginx/dhparams.pem:ro \
--volume /root/webapp/data/nginx/conf.d/:/etc/nginx/conf.d/:ro \
--volume /root/webapp/log/nginx/:/var/log/nginx/ \
--volume /root/webapp/data/ssl:/etc/nginx/ssl/ \
--replace \
docker.io/library/nginx:latest
podman start nginx
podman create \
--name acme \
--pod webapp \
--systemd false \
--volume /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro \
--volume /run/podman/podman.sock:/var/run/docker.sock:ro \
--volume /root/webapp/data/acme.sh:/acme.sh \
-e DEPLOY_DOCKER_CONTAINER_LABEL="app=nginx" \
-e DEPLOY_DOCKER_CONTAINER_RELOAD_CMD="nginx -s reload" \
--replace \
docker.io/neilpang/acme.sh:latest daemon
podman start acme
my deploy function:
acmedp()
{
for i ($*)
{
mkdir -p "/root/webapp/data/ssl/$i"
podman exec \
-e DEPLOY_DOCKER_CONTAINER_KEY_FILE="/etc/nginx/ssl/$i/key.pem" \
-e DEPLOY_DOCKER_CONTAINER_CERT_FILE="/etc/nginx/ssl/$i/cert.pem" \
-e DEPLOY_DOCKER_CONTAINER_CA_FILE="/etc/nginx/ssl/$i/ca.pem" \
-e DEPLOY_DOCKER_CONTAINER_FULLCHAIN_FILE="/etc/nginx/ssl/$i/full.pem" \
-it acme acme.sh \
--deploy-hook docker \
--deploy -d $i
}
}
before this issue fix, i just download the raw file of docker.sh
and change the Detach to true, the append this line after podman start acme
podman cp /root/webapp/patches/acme.sh/docker.sh acme:/root/.acme.sh/deploy/docker.sh
Steps to reproduce
-v /run/user/0/podman/podman.sock:/var/run/docker.sock
.--deploy-hook docker
Debug log
Other infomation
https://github.com/testcontainers/testcontainers-go/issues/336