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

Question: apko should be support copy files? #852

Closed
lpcalisi opened this issue Aug 19, 2023 · 7 comments
Closed

Question: apko should be support copy files? #852

lpcalisi opened this issue Aug 19, 2023 · 7 comments

Comments

@lpcalisi
Copy link

apko have the chance to copy some files? or execute something?

apko is great to gen base images, but is common require that this bases images need some configuration file or script and they are copied in base image in order to abstrac final application images (or images uses for build). Does it make sense? Or we should make this inside of a build system?

@lpcalisi
Copy link
Author

@tuananh
Copy link

tuananh commented Aug 23, 2023

the current approach to package them into apk package like this i think https://github.com/wolfi-dev/os/blob/main/container-entrypoint.yaml

@lpcalisi
Copy link
Author

thanks @tuananh. I understand that apko should not be able to exec anything in the build that could variate, because this could be against to reproducible and declarative nature.
And.. another example could be, supposing that i'm creating my own nginx base image using apko, and.. i want copy a specific nginx.conf file with some configurations to my final users. Could it be a valid apko case of use?
I suppose it could have this file in the same git repository that apko.yaml file, and this would not change the final result in bits. In case apko don't support this and i will like to use it anyway, should i create a apk with this config file? isn't it too much?

@jpolania
Copy link

Having support to copy files (which can be anything from binaries, config file, execution code, etc)

If apko whats to be better than Dockerfile ... then I'd suggest have either apko or melange support COPY files/folder funtionality

@kaniini
Copy link
Contributor

kaniini commented Nov 22, 2023

Yes, you can copy files into an apk with melange. It’s already supported.

@kaniini kaniini closed this as completed Nov 22, 2023
@jpolania
Copy link

jpolania commented Nov 23, 2023

Just to clarify on this issue. Apko doesn't support copy files and seems to be is the architecture design

If you want to use the copy file function in melange here is a basic example

Imagine you have a file called mycode.sh and you want that file inside your apk image via melange. You need to copy from BUILD_DIR to ${{targets.destdir}}

Example of melange pipeline section

pipeline:
  - runs: |
      BUILD_DIR="/home/build"
      cp "${BUILD_DIR}/mycode.sh" "${{targets.destdir}}/mycode.sh"
      ...
      ...

Hope that helps to everyone who read this post

@tuananh
Copy link

tuananh commented Nov 23, 2023

i have an example (template) here how to package file with melange and then use that package in apko.

https://github.com/tuananh/apko-image-template

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

No branches or pull requests

4 participants