Skip to content

Commit

Permalink
docker_ifexgen: Update wrapper to run "containerized" ifexgen
Browse files Browse the repository at this point in the history
This is a wrapper that the user can invoke instead of ifexgen
to execute the tool in the container installation instead of a local
installation.  The usage should be identical, hopefully.
(It existed before but is now matching the updated container setup)

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
  • Loading branch information
Gunnar Andersson committed Aug 10, 2023
1 parent fb4ec84 commit 26a45c9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scripts/docker_ifexgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@
# This file is part of IFEX project
# ---------------------------------------------------------------------------

IMAGE_NAME=ifex-docker
IMAGE_NAME=ifex_local/ifex_alpine
CTR_NAME=ifex-docker

# Normalize directory location
cd "$(dirname "$0")" # (the directory this script is in)
cd ..

if ! docker images | fgrep -q "$IMAGE_NAME"; then
if ! docker images | grep -F -q "$IMAGE_NAME"; then
echo Image never built from Dockerfile -- building...
docker build --tag "$IMAGE_NAME" .
cd docker && make build
fi

if docker ps -a | fgrep -q "$CTR_NAME"; then
if docker ps -a | grep -F -q "$CTR_NAME"; then
echo Removing old container $CTR_NAME
docker rm "$CTR_NAME"
fi

#docker run --rm -ti --name "$CTR_NAME" "$IMAGE_NAME" ifexgen
docker run --rm -ti --name "$CTR_NAME" "$IMAGE_NAME" bash
# SELINUX required flag
fgrep -Fq redhat /etc/os-release && ZFLAG=:z || ZFLAG=

set -x
docker run --rm -ti -v $PWD:/work${ZFLAG} --name "$CTR_NAME" "$IMAGE_NAME" /ifex/venv/bin/ifexgen "$@"

0 comments on commit 26a45c9

Please sign in to comment.