Skip to content

Commit 2fdd13d

Browse files
committed
added the possibility for build args
1 parent a744dae commit 2fdd13d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
version: "3.5"
1+
version: "3.8"
22
services:
33

44
cve_search:
55
image: cve_search
66
build:
77
context: .
88
dockerfile: docker/images/cve_search/dockerfile-cve_search
9+
args:
10+
- REPO=cve-search/cve-search
11+
- BRANCH=master
912
hostname: cve_search
1013
depends_on:
1114
- redis

docker/images/cve_search/dockerfile-cve_search

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ ENV APP /app
1010
RUN mkdir $APP
1111
WORKDIR $APP
1212

13-
RUN git clone https://github.com/cve-search/cve-search.git ./
13+
ARG REPO
14+
ARG BRANCH
15+
16+
RUN echo "Using repo - branch: $REPO - $BRANCH"
17+
18+
RUN git clone -b $BRANCH --single-branch https://github.com/$REPO.git ./
1419

1520
# Install the dependencies
1621
RUN pip install -r requirements.txt

0 commit comments

Comments
 (0)