Skip to content

Commit

Permalink
Merge pull request #20 from oislen/dev
Browse files Browse the repository at this point in the history
19 Parameterise Dockerfile Branch
  • Loading branch information
oislen authored Oct 7, 2024
2 parents 630b328 + 44d46e2 commit fdade9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dockerhub-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
tags: oislen/randomtelecompayments:latest
tags: oislen/randomtelecompayments:latest
build-args: GIT_BRANCH=main
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ FROM ubuntu:20.04
# set environment variables
ENV user=ubuntu
ENV DEBIAN_FRONTEND=noninteractive
# set git branch for cloning
ARG GIT_BRANCH
ENV GIT_BRANCH=${GIT_BRANCH}

# install required software and programmes for development environment
RUN apt-get update
Expand All @@ -14,7 +17,7 @@ RUN useradd ${user}
RUN mkdir -p /home/${user} && chown -R ${user}: /home/${user}

# clone git repo
RUN git clone https://github.com/oislen/RandomTelecomPayments.git --branch randomtelecompayments_dev_1.0 /home/ubuntu/RandomTelecomPayments
RUN git clone https://github.com/oislen/RandomTelecomPayments.git --branch ${GIT_BRANCH} /home/ubuntu/RandomTelecomPayments

# install required python packages
COPY requirements.txt /tmp/
Expand Down
3 changes: 2 additions & 1 deletion exeDocker.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ SET DOCKER_REPO=randomtelecompayments
SET DOCKER_TAG=latest
SET DOCKER_IMAGE=%DOCKER_USER%/%DOCKER_REPO%:%DOCKER_TAG%
SET DOCKER_CONTAINER_NAME=rtp
SET GIT_BRANCH=v0.0.0

:: remove existing docker containers and images
docker image rm -f %DOCKER_IMAGE%

:: build docker image
call docker build --no-cache -t %DOCKER_IMAGE% .
call docker build --no-cache -t %DOCKER_IMAGE% . --build-arg GIT_BRANCH=%GIT_BRANCH%

:: run docker container
SET UBUNTU_DIR=/home/ubuntu
Expand Down

0 comments on commit fdade9d

Please sign in to comment.