Skip to content

Only copy agent code in dockerfiles#3393

Merged
jamshale merged 4 commits intoopenwallet-foundation:mainfrom
jamshale:adjust-dockerfiles
Jan 14, 2025
Merged

Only copy agent code in dockerfiles#3393
jamshale merged 4 commits intoopenwallet-foundation:mainfrom
jamshale:adjust-dockerfiles

Conversation

@jamshale
Copy link
Contributor

@jamshale jamshale commented Dec 9, 2024

The dockerfiles don't need to copy the entire repo into the base, run, and test images. They should only copy the project files and the actual agent code.

Found some old aries_cloudagent naming that should be updated.

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
@sonarqubecloud
Copy link

Copy link
Contributor

@WadeBarnes WadeBarnes left a comment

Choose a reason for hiding this comment

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

The other way to handle this, which is possibly more manageable long term, is with .dockerignore files, which seem to already be in use; https://github.com/openwallet-foundation/acapy/blob/main/.dockerignore

image

It might be an idea to add a comment in the dockerfiles referencing the .dockerignore filtering their content. That way it's clear where the content of the dockerfile is controlled.

@jamshale
Copy link
Contributor Author

It might be an idea to add a comment in the dockerfiles referencing the .dockerignore filtering their content. That way it's clear where the content of the dockerfile is controlled.

Sounds good. I wasn't aware of that. I will do an overview of this.

@jamshale
Copy link
Contributor Author

I'm somewhat confused as to why the demo code is included. Seems like there's a lot of code there that shouldn't be.

@WadeBarnes
Copy link
Contributor

I'm somewhat confused as to why the demo code is included. Seems like there's a lot of code there that shouldn't be.

That screenshot is just a list showing all of the places a .dockerignore file are being used in the project.

@jamshale
Copy link
Contributor Author

I'll rebase and test this a bit more. I think it would be good to have.

The .dockerignore file doesn't really help us because it applies to every Dockerfile in the docker folder, and different files are included for the different images. A comment mentioning those files are also ignored would be good to have, though.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 14, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@jamshale
Copy link
Contributor Author

I tried to test all usages of these dockerfiles I could think of. There's a chance that a process I don't know about expects the files I removed to be there and will break and would need to be added back.

The most important ones are used in automatic testing.

@jamshale jamshale merged commit dea4e09 into openwallet-foundation:main Jan 14, 2025
11 checks passed
ff137 pushed a commit to didx-xyz/acapy that referenced this pull request Jan 29, 2025
* Only copy agent code in dockerfiles

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Add README.md file

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Run testing workflows on docker dir changes

Signed-off-by: jamshale <jamiehalebc@gmail.com>

---------

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Co-authored-by: Stephen Curran <swcurran@gmail.com>
ff137 pushed a commit to didx-xyz/acapy that referenced this pull request Feb 13, 2025
* Only copy agent code in dockerfiles

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Add README.md file

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Run testing workflows on docker dir changes

Signed-off-by: jamshale <jamiehalebc@gmail.com>

---------

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Co-authored-by: Stephen Curran <swcurran@gmail.com>
ff137 pushed a commit to didx-xyz/acapy that referenced this pull request Feb 13, 2025
* Only copy agent code in dockerfiles

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Add README.md file

Signed-off-by: jamshale <jamiehalebc@gmail.com>

* Run testing workflows on docker dir changes

Signed-off-by: jamshale <jamiehalebc@gmail.com>

---------

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Co-authored-by: Stephen Curran <swcurran@gmail.com>
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