Reputation: 3632
I am trying to reduce the buildtime for my docker image.
I have to install node dependency for backend and bower dependency from UI.
Right now it runs sequentially from 2 different workdir.
WORKDIR $CLIENT_DIR
RUN bower --allow-root install
WORKDIR $SERVER_DIR
RUN npm install
Since both are independent on each other, its annoying to wait for bower install to finish for installing npm install.
I think docker will have better way to handle such cases.
I think my question is clean, and doesn't need more info. Please let me know if I should provide some other infor as well.
Upvotes: 1
Views: 35
Reputation: 6765
Since docker is building its images in layers, you will not be able to run this dockerfile as it is in parallel.
Here are 2 workarounds I can think of that might allow for parallelism, but IMO are a bigger effort than the value they will give you -
Upvotes: 1