Reusing a previoulsy used docker container -
if in docker container, can stopped using ctrl+p+q or using exit command after exiting container, how save state can use same container changes still there. if use docker commit save container, hangs. there method use container same state @ exited it?
you place source control operations last run listed in dockerfile.
but in order make unique command, ensuring gets run each time, wrap docker build in script generates uniquely-numbered mini-script clone operation.
this step insert invocation of script dockerfile generated on-the-fly prior build time, such operation must run every time – clone – run statement indeed unique, i.e.
run /bin/sh /foo-1234567abc.sh
where foo-1234567abc
uniquely generated each build (and subsequent executions create foo-26190def.sh
) , contains clone operation, i.e.
cd /some/dir && /usr/bin/git clone http://some.git.server/your-repo.git
which may infrequently — or never — change.
this guarantees docker run clone during each build while having advantages of being both automated , ensuring cache used right last unique run.
for more information see here
Comments
Post a Comment