Sections
- multiple sections with the same name can be included and will be appended to one another during the build process.
%setup
- Executes the commands on the host system after base operating system is installed in the container.
- This section is usually not used as it is dangerous.
%files
- This section is used to copy files from host system to container. Also, from previous stage specified.
%files
section is executed before %post
so that files are available while build process in %post
.
source
can be a path from host system or path in previous stage if specified. destination
is the path in the container.
- if
destination
is not specified, source
path is used for destination
.
# copying file from host to container
%files
/from-host /to-container
# copying file from previous stage to current container
%files prev_stage
/from /to-container