-
Notifications
You must be signed in to change notification settings - Fork 32
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
FEATURE: Adapt Dockefiles to use Entrypoint or to only have the static tasks that depends on no variables #235
Comments
Hi all! To do so, we firstly should determine which of the tasks are build-dependent or not, and those non-build-dependent are characterized to be executed only once, such as:
build-dependent tasks are, for example:
ENTRYPOINT We need to use ENTRYPOINT to indicate to Docker the tasks that should be run only when starting a container, and in our case and as the tasks are multiple then we create a
Which is only used to make the container alive once the script execution is finished.
This script takes 3 parameters:
Which take the correponding values in container creation's time, as follows:
Dockerfile wazuh-qa/kitchen/wazuh-chef/manager/files/entrypoint/Dockerfile Lines 1 to 33 in 064dd6a
As you can see in the docker file we copy the script from our local machine to the "container to create" into the folder
Then we give it the proper permissions and create a symbolic link.
And then we call
Kr, Rshad |
Hi all!
Objective
Reduce docker-image build time.
Actual Behavior
Now and for example in https://github.com/wazuh/wazuh-qa/blob/devel/kitchen/wazuh-chef/manager/files/dockerfile, it takes a long time when building the corresponding Docker image due to that we install the mentioned Ruby gems on each time we build the image. We build the image on each pipeline's build because it's dependent on the source and target branch of the targeted PR.
Expected Behavior
Build the image once. We can build the image once, by only executing the general or non--execution-dependent tasks and let the dependent tasks to be executed when a container is started.
For example, to build the image we would only need to import the image
ruby
for example, install docker and install Ruby gems.Then we let the tasks like
cloning a rep. detecting branch, etc ...
to be executed only when starting a new container.Proposed Tasks to Complete the Required Changes
Making use of docker Entrypoint:
Note
: This issue's description may be updated in the future if needed.Kr,
Rshad Zhran
The text was updated successfully, but these errors were encountered: