Skip to content
Snippets Groups Projects
Commit 7223f160 authored by Radoslav Bodó's avatar Radoslav Bodó
Browse files

general: add basic docker support

parent b2130fe2
No related branches found
No related tags found
No related merge requests found
Pipeline #7691 passed
.gitignore
\ No newline at end of file
FROM debian:bookworm-slim
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
make \
python3
WORKDIR /opt/rwm
COPY rwm.py Makefile ./
RUN make install
ENTRYPOINT ["/opt/rwm/rwm.py"]
......@@ -50,3 +50,9 @@ microceph: microceph-cleanup microceph-service
runner:
apt-get install -y ansible
ansible-playbook scripts/playbook_gitlab_runner.yml
docker-build:
sh scripts/docker.sh build
docker-push:
sh scripts/docker.sh push
#!/bin/sh
# release helper
REGISTRY_URL="gitlab-registry.cesnet.cz"
IMAGE_NAME="radoslav_bodo/rwm"
BRANCH=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
if [ -z "$BRANCH" ]; then
echo "Error: Unable to determine current branch."
exit 1
fi
case "$1" in
login)
docker login "$REGISTRY_URL"
;;
build)
docker build -t "${REGISTRY_URL}/${IMAGE_NAME}:${BRANCH}" .
;;
push)
docker push "${REGISTRY_URL}/${IMAGE_NAME}:${BRANCH}"
;;
pull)
docker image pull "${REGISTRY_URL}/${IMAGE_NAME}:${BRANCH}"
;;
run)
shift
docker run --rm -v "$(pwd)/rwm.conf:/opt/rwm/rwm.conf" -it "${REGISTRY_URL}/${IMAGE_NAME}:${BRANCH}" "$@"
;;
*)
echo "invalid command"
exit 1
;;
esac
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment