Skip to content

docker: initial checkin Dockerfile for nuttx github action container #13

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

Closed
wants to merge 1 commit into from

Conversation

liuguo09
Copy link
Contributor

@liuguo09 liuguo09 commented Mar 6, 2020

The corresponding docker image:
docker pull liuguo09/ubuntu-nuttx:tagname

Now it is temporarily use personal account to place. Swith to apache docker
once available. Also note the toolchains packages used in Dockerfile are all
locally added which should be downloaded from network instead in future.

The corresponding docker image:
docker pull liuguo09/ubuntu-nuttx:tagname

Now it is temporarily use personal account to place. Swith to apache docker
once available. Also note the toolchains packages used in Dockerfile are all
locally added which should be downloaded from network instead in future.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>

WORKDIR /prebuilt

ADD gcc-arm-none-eabi.tar.gz ./
Copy link
Contributor

Choose a reason for hiding this comment

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

change to download from offical release website

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update it later.

@@ -0,0 +1,34 @@
FROM ubuntu:18.04
Copy link
Contributor

Choose a reason for hiding this comment

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

Change Dockerfile to another specific name, because other people may add macOS or Windows dockerfile later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update it later.

@btashton
Copy link
Contributor

btashton commented Mar 6, 2020

@liuguo09 I'll make some detailed comments tonight. Including the multistage image which will resolve the issue of the local builds of the tools.

@liuguo09
Copy link
Contributor Author

liuguo09 commented Mar 7, 2020

@liuguo09 I'll make some detailed comments tonight. Including the multistage image which will resolve the issue of the local builds of the tools.

Wish your feedback : )

Copy link
Contributor

@btashton btashton left a comment

Choose a reason for hiding this comment

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

Is there a reason we are building git instead of the os version?

@liuguo09
Copy link
Contributor Author

liuguo09 commented Mar 7, 2020

Sorry I don't remember very clearly. It seems in the workflow checkout stages, it mentioned to use 2.18 or later version. With the os version git 2.17.1, it doesn't work well. I'll confirm it later.

@liuguo09 liuguo09 force-pushed the master branch 2 times, most recently from bd840c2 to 32868f8 Compare March 12, 2020 08:29
@btashton
Copy link
Contributor

@liuguo09 Sorry this took me so long. Have a look at what I have done over here:
https://github.com/btashton/nuttx-build-containers

The docker file is split into a bunch of stages which makes it a lot faster to rebuild and keeps the build time dependencies isolated from the rest of the image. Note that I am not downloading all of the toolchains now instead of copying local ones in.

I also have a github action wired up to that to create the docker image and place it in the github project package registry.

On thing I think we should consider is using that structure to create images that each have the needed toolchains they are very large and the ARM builds should not be paying the cost of the RISCV, but I think this is a later improvement that can be made.

You can see this integrated and running here:
https://github.com/btashton/incubator-nuttx/runs/508883969

Let me know how you think and we can look at moving it forward.

@liuguo09
Copy link
Contributor Author

@btashton thanks, I'll look into it and feedback later.

@liuguo09
Copy link
Contributor Author

@liuguo09 Sorry this took me so long. Have a look at what I have done over here:
https://github.com/btashton/nuttx-build-containers

The docker file is split into a bunch of stages which makes it a lot faster to rebuild and keeps the build time dependencies isolated from the rest of the image. Note that I am not downloading all of the toolchains now instead of copying local ones in.

@btashton I notice it reduce half of time for pull the docker. It's really a good job. I totally agree with using a bunch of stages in Dockerfile to faster rebuild. Do we need a official nuttx build contianer repo or just include it in testing repo?

I also have a github action wired up to that to create the docker image and place it in the github project package registry.

Since now we are using our own account to create docker image, how about switch to the official https://hub.docker.com/u/apache to hold it? I have issued a Jira before https://issues.apache.org/jira/browse/INFRA-19930 and the Infra team have responded to help setup. And it required the nuttx committer permission to access. You may the right person to access as you are skilled in docker : )

On thing I think we should consider is using that structure to create images that each have the needed toolchains they are very large and the ARM builds should not be paying the cost of the RISCV, but I think this is a later improvement that can be made.

If the time reduced not much now, I think it may be well to keep arm and riscv toolchains together now. But considering more toolchains coming for other archs, it may be reasonable to restructure in later improvement.

You can see this integrated and running here:
https://github.com/btashton/incubator-nuttx/runs/508883969

Let me know how you think and we can look at moving it forward.

@btashton
Copy link
Contributor

Did you notice that the docker container is now built via actions and stored in the GitHub package registry? That means it would be stored in the project and not require docker hub. But we can go that way I'm just not sure how much access we have to GitHub secrets for uploading the image.

@liuguo09
Copy link
Contributor Author

Yes, I noticed the docker publish github aciton. It seems more flexible than docker hub. If taking github package registry approach, do we need an official repo such as incubator-nuttx-build-contianers or use personal contianer project as yours is enough?

@liuguo09
Copy link
Contributor Author

Or is it possible just using the incubator-nuttx-testing to hold dockerfile and do docker publish github action?

@btashton
Copy link
Contributor

btashton commented Mar 17, 2020

My plan was to use the incubator-nuttx-testing repo. I can submit a PR with this and the action to the repo.

@liuguo09
Copy link
Contributor Author

My plan was to use the incubator-nuttx-testing repo. I can submit a PR with this and the action to the repo.

That's great!

@xiaoxiang781216
Copy link
Contributor

Replace by #17, let close it.

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.

3 participants