From d2cbcf7118eea6be2a6da315fb5a5442f8bf719e Mon Sep 17 00:00:00 2001 From: Bostjan Meglic <103102696+bmeglicit@users.noreply.github.com> Date: Sun, 19 Jun 2022 11:18:09 +0200 Subject: [PATCH] [build] Use local sources to build applications (#1583) "build" Docker image previously downloaded latest version of Open5GS from github, and built the project from that. Use local source files for building instead. --- .dockerignore | 10 ++++++++++ docker/build/Dockerfile | 15 ++++----------- docker/docker-compose.yml | 3 ++- 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..738a20da7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +**/*.md +**/docker-compose*.yml +**/docker-compose*.yaml +**/Dockerfile* +.git +.dockerignore +.cache +.gitignore +.github +build diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index d0dfd3ef7..ed2d36427 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -5,15 +5,8 @@ FROM ${username}/${dist}-${tag}-open5gs-base MAINTAINER Sukchan Lee -WORKDIR /root -COPY setup.sh /root +WORKDIR /open5gs +COPY docker/build/setup.sh /root +COPY ./ /open5gs -ARG USER=open5gs -ARG REPO=open5gs -ARG BRANCH=main -RUN git clone https://github.com/$USER/$REPO -ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/open5gs-ver.json - -RUN cd $REPO && \ - git fetch && git checkout -f -B $BRANCH origin/$BRANCH && \ - meson build && ninja -C build install +RUN meson build && ninja -C build install diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3517ff496..5b2cc6d0e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -33,7 +33,8 @@ services: build: build: - context: ./build + context: ../ + dockerfile: docker/build/Dockerfile args: dist: ${DIST-ubuntu} tag: ${TAG-latest}