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}