General idea is that you just copy this structure and edit (possibly extend) the container build part (Dockerfile, scripts, configs), and test.sh.
build.sh, upload.sh, cleanup.sh are reusable without the need for any changes.
Easiest way to take advantage of this template is:
- Clone it via https
git clone https://github.com/marekruzicka/docker-template.git
- Rename docker-template ('template') directory to reflect your application (keep the 'docker-' part)
mv docker-template docker-<name_of_your_app>
and enter the directory
cd docker-<name_of_your_app>
- Remove the existing '.git' directory
rm -rf .git
- Create new project on GitLab and follow the steps in "Existing folder" part
example:
git init
git remote add origin <path to your git repo>
git add .
git commit -m "Initial commit"
git push -u origin master
- Create initial git tag and push it upstream
git tag devel
git push origin --tags
You can choose any tag you like (eg. v0.0), but you have to set one.
-
Enable container registry and setup git strategy in project settings
Settings -> Permissions -> container registry enable
Settings -> CI/CD -> General pipelines settings -> Git strategy for pipelines set to git clone
(don't forget to 'save changes' after each step) -
Think about how are you going to test your container and edit 'test'sh' accordingly
If you skip this step now, your CICD pipeline (automatic test/build workflow will fail by design) -
Update the README.md file
Unless you believe this how to is appropriate for your project as well :)