creating services for podman
creating systemd service to autostart container when the server is rebooted, when using podman-docker
This commit is contained in:
parent
3fc1a51a4c
commit
4f77d7ba70
1 changed files with 5 additions and 2 deletions
|
|
@ -14,5 +14,8 @@ if [ -n "$(sudo docker --version 2>/dev/null | grep podman)" ]; then sudo sh -c
|
|||
' \"alpine\" = \"docker.io/library/alpine\"' \
|
||||
' # Amnezia finish' \
|
||||
>> /var/cache/containers/short-name-aliases.conf";\
|
||||
fi;\
|
||||
sudo docker build --no-cache --pull -t $CONTAINER_NAME $DOCKERFILE_FOLDER
|
||||
sudo docker build --no-cache --pull -t $CONTAINER_NAME $DOCKERFILE_FOLDER && sudo sh -c '\
|
||||
podman generate systemd --name $CONTAINER_NAME 2>/dev/null > $DOCKERFILE_FOLDER/container-$CONTAINER_NAME.service && \
|
||||
systemctl enable $DOCKERFILE_FOLDER/container-$CONTAINER_NAME.service';\
|
||||
else sudo docker build --no-cache --pull -t $CONTAINER_NAME $DOCKERFILE_FOLDER;\
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue