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

VSCode : Enable Development inside Docker Container #385

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

embetrix
Copy link
Contributor

@embetrix embetrix commented Jun 12, 2024

This will enable seamless Development of optee_client Project with VSCode
inside Docker container.

The VSCode Container provides:

  • Automatic Mapping of the host user UID/GID inside the container
  • Cross-Compilers (aarch64/armhf)
  • GDB Multiarch for Debugging
  • Remote SSH on the Target with seamless ssh mapping of the Host inside the container (Linux/Windows WSL)
  • Git and Git Extensions to work and send Patches

Note: This require Docker installation for Linux/or Windows :
[1] https://docs.docker.com/engine/install

  VSCode Extensions (extensions.json) will be recommended for the installation

For more Information :
[2] https://code.visualstudio.com/docs/devcontainers/containers
[3] https://www.youtube.com/watch?v=C_5tDWsWSj0
[4] https://www.youtube.com/watch?v=b1RavPr_878

@embetrix embetrix force-pushed the feature/docker-vscode branch 2 times, most recently from f46c3aa to 7c5025d Compare June 12, 2024 10:24
@jforissier
Copy link
Contributor

Hello @embetrix,

That looks useful, but could you give more information in the commit description? Such as how this is typically used in a development environment. I do not ask for a very detailed documentation but a few commands and explanations on the steps that are involved to build and run the project. Thanks!

@embetrix embetrix force-pushed the feature/docker-vscode branch 3 times, most recently from 00c868b to 3543148 Compare June 12, 2024 11:51
@embetrix embetrix changed the title VSCode : Add Docker Integration VSCode : Enable Development inside Docker Container Jun 12, 2024
@embetrix
Copy link
Contributor Author

embetrix commented Jun 12, 2024

Hello @embetrix,

That looks useful, but could you give more information in the commit description? Such as how this is typically used in a development environment. I do not ask for a very detailed documentation but a few commands and explanations on the steps that are involved to build and run the project. Thanks!

@jforissier : I added some information, normally everthing should be automatically set by VSCode just by accepting the extension recommendations and openning the project inside the container.

@embetrix embetrix force-pushed the feature/docker-vscode branch 3 times, most recently from f8b4390 to 9be779e Compare June 12, 2024 12:00
@embetrix
Copy link
Contributor Author

@jforissier any update ?

Dockerfile Outdated
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse' > /etc/apt/sources.list
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse' >> /etc/apt/sources.list
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Isn't this in the ubuntu:22.04 image already?

Dockerfile Outdated
Comment on lines 28 to 29
uuid-dev:armhf \
uuid-dev:arm64
Copy link
Contributor

Choose a reason for hiding this comment

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

In https://optee.readthedocs.io/en/latest/building/prerequisites.html we have uuid-dev (host architecture). Why are :armhf and :arm64 needed?

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 took all those from CI Dockerfile: https://github.com/OP-TEE/optee_client/blob/master/ci/Dockerfile.ubuntu, I just extended it to include additional dev tools.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK now I remember, they are required for the CMake build which uses pkg-config for cross-compilation.

{
"name": "optee-client-docker",
"build": {
"dockerfile": "../Dockerfile"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we rename this file to Dockerfile.vscode and store it here under .devcontainer/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Dockerfile Outdated
Comment on lines 28 to 29
uuid-dev:armhf \
uuid-dev:arm64
Copy link
Contributor

Choose a reason for hiding this comment

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

OK now I remember, they are required for the CMake build which uses pkg-config for cross-compilation.

@embetrix embetrix force-pushed the feature/docker-vscode branch from 9be779e to 75eadaf Compare June 25, 2024 10:01
Copy link
Contributor

@jforissier jforissier left a comment

Choose a reason for hiding this comment

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

Acked-by: Jerome Forissier <[email protected]>

Thanks!

Copy link

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Jul 26, 2024
@github-actions github-actions bot closed this Aug 1, 2024
@embetrix
Copy link
Contributor Author

@jforissier any update on this ? it was somehow closed !

Copy link
Contributor

@jforissier jforissier left a comment

Choose a reason for hiding this comment

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

Please see comment below. Thanks.

.devcontainer/Dockerfile.vscode Show resolved Hide resolved
@jforissier jforissier reopened this Nov 28, 2024
This will enable seamless Development of optee_client Project with VSCode
inside Docker container.

The VSCode Container provides:

* Automatic Mapping of the host user UID/GID inside the container
* Cross-Compilers (aarch64/armhf)
* GDB Multiarch for Debugging
* Remote SSH on the Target with seamless ssh mapping of the Host inside the container (Linux/Windows WSL)
* Git and Git Extensions to work and send Patches

Note: This require Docker installation for Linux/or Windows :
      [1] https://docs.docker.com/engine/install

      VSCode Extensions (extensions.json) will be recommended for the installation

For more Information :
[2] https://code.visualstudio.com/docs/devcontainers/containers
[3] https://www.youtube.com/watch?v=C_5tDWsWSj0
[4] https://www.youtube.com/watch?v=b1RavPr_878

Signed-off-by: Ayoub Zaki <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
@embetrix embetrix force-pushed the feature/docker-vscode branch from 75eadaf to fbd584e Compare November 28, 2024 16:28
@jforissier jforissier merged commit 0a22c22 into OP-TEE:master Nov 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants