Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unnecessary docker images for local sources #70

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

ianchen0119
Copy link
Collaborator

No description provided.

@abousselmi
Copy link
Collaborator

abousselmi commented Feb 8, 2023

The new dockerfiles were added by PR #69 that was approved by @tim-ywliu
If you want to remove it, it would be better if you entirely revert the PR.
@tim-ywliu what do you think about this ?

@tim-ywliu
Copy link
Collaborator

The new dockerfiles were added by PR #69 that was approved by @tim-ywliu If you want to remove it, it would be better if you entirely revert the PR. @tim-ywliu what do you think about this ?

@abousselmi I think it is better to reuse same Dockerfile to build and less maintaining effort.

@@ -9,7 +9,10 @@ ENV DEBIAN_FRONTEND noninteractive
ARG DEBUG_TOOLS

# Install debug tools ~ 100MB (if DEBUG_TOOLS is set to true)
RUN if [ "$DEBUG_TOOLS" = "true" ] ; then apt-get update && apt-get install -y vim strace net-tools iputils-ping curl netcat ; fi
RUN if [ "$DEBUG_TOOLS" = "true" ] ; then apt-get update && apt-get install -y golang-go git vim strace net-tools iputils-ping curl netcat && \
git clone https://github.com/free5gc/go-gtp5gnl.git && mkdir "go-gtp5gnl/bin" && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move go-gtp5gnl tool build to base Dockerfile and copy it from base

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I move this build action to the base Dockerfile, I think it can't be optional due to we won't use the base image directly (Won't use DEBUG_TOOLS).

@@ -16,7 +16,7 @@ ARG F5GC_MODULE
COPY free5gc/ $GOPATH/src/free5gc/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can merge all base Dockerfile into one.
use COPY free5gc as default Dockerfile setting.
always git clone free5gc into base folder first when using local build.

@abousselmi
Copy link
Collaborator

LGTM

@tim-ywliu tim-ywliu merged commit 1031674 into master Feb 9, 2023
@tim-ywliu tim-ywliu deleted the feat/local-sources branch February 9, 2023 17:01
@aviweit
Copy link
Contributor

aviweit commented Feb 11, 2023

Hi @ianchen0119 , @tim-ywliu ,
I installed lasted free5gc-compose repository that includes this PR. I would like to ask how can I build a specific network function (e.g. amf) as supported by PR #69?

The readme states:

# Alternatively you can build specific NF image e.g.:
make amf
docker compose -f docker-compose-build.yaml build free5gc-amf

I tried this but make amf fails with no rule. Please note that Makefile of PR #69 included rules for specific NFs.

Thanks.

@ianchen0119
Copy link
Collaborator Author

Hi @aviweit
You can try this:

make all
docker compose -f docker-compose-build.yaml build free5gc-amf

@aviweit
Copy link
Contributor

aviweit commented Feb 14, 2023

Hi @ianchen0119 ,

I tried it.
make all compiles all NFs into the base docker image, even if I only modify a specific NF code (e.g. smf).
Compiling all NFs takes long time.

I looked into docker compose -f docker-compose-build.yaml build free5gc-amf.
It uses nf_amf/Dockerfile that copies amf binary and libraries from base image. That binary, from base image, had been created during compilation time of all NFs, via make all command.

I think it would be very good to provide the ability to compile a specific NF which saves a lot of time. I am using #69 to compile only the NF I am working on.
The Makefile has rule for every NF. That rule delegates the request to the free5gc/Makefile and generates docker image only for that NF binaries.

What do you think ?

@ianchen0119
Copy link
Collaborator Author

Hi @aviweit
I think the PR you proposed can save more time on your demand certainly.
But I have the problem is:
Each NF has its own Dockerfile.nf file and all of these files have a lot of similarities.
Do you have any idea to remove the duplicated file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants