{"id":27211523,"url":"https://github.com/sverrenystad/course-on-git-and-docker","last_synced_at":"2026-05-02T02:38:28.762Z","repository":{"id":222655511,"uuid":"755607105","full_name":"SverreNystad/course-on-git-and-docker","owner":"SverreNystad","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-15T20:48:25.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T08:47:11.879Z","etag":null,"topics":["docker","git"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SverreNystad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-10T18:12:04.000Z","updated_at":"2024-02-15T16:01:16.000Z","dependencies_parsed_at":"2024-02-15T14:26:15.629Z","dependency_job_id":"a1a80fdc-b5ea-4e83-8489-c125b6302c06","html_url":"https://github.com/SverreNystad/course-on-git-and-docker","commit_stats":null,"previous_names":["sverrenystad/course-on-git-and-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SverreNystad%2Fcourse-on-git-and-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SverreNystad%2Fcourse-on-git-and-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SverreNystad%2Fcourse-on-git-and-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SverreNystad%2Fcourse-on-git-and-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SverreNystad","download_url":"https://codeload.github.com/SverreNystad/course-on-git-and-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140105,"owners_count":21054236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","git"],"created_at":"2025-04-10T01:29:38.350Z","updated_at":"2026-05-02T02:38:28.697Z","avatar_url":"https://github.com/SverreNystad.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git and Docker Course\nAccompanying presentation can be found [here](https://docs.google.com/presentation/d/1haH8cLeZ95V6aTcdJPhm0mP9muZv_u7NCb_go_Od8s8/edit#slide=id.g2b9969c2c06_0_0)\n\n## Part 1: Git\n\n### Task 0: Initial Setup\nFor this workshop, you will need to have Git installed on your machine and have a GitHub account.\n\nIf you don't have git installed, follow the instructions below to install it.\n* Install git on your machine\n  - [Windows](https://git-scm.com/download/win)\n    * Press `Win + R` then write `cmd`\n    * ```cmd\n        winget install --id Git.Git -e --source winget\n      ```\n      Or download installer from [here](https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe)\n  - [Mac](https://git-scm.com/download/mac)\n    * Make sure to have brew installed if you don't have it follow [this](https://brew.sh/)\n    * ```bash\n      brew install git\n      ``` \n  - [Linux](https://git-scm.com/download/linux)\n    * You probalby allready have Git preinstalled lmao enjoy\n    * If you somehow don't gave git see [here](https://git-scm.com/download/linux) for instructions for your distro\n\nTo validate that git is installed, open a terminal/cmd and write \n```bash\ngit --version\n```\nIf you get a version number, you are good to go.\n\n* Create a github account [Github](https://github.com/) if you don't have one already\n\n\n### Task 1: Cloning the repository\n* Clone the repository in the directory of your choosing (open a terminal/cmd in that directory)\n```bash\ngit clone https://github.com/SverreNystad/git-course.git\n```\nthen change to the directory `git-course`\n\n### Task 2: Adding a file to the repository\n1. Create a new file named after your first and last name in the greeting_of_cogito folder. Write a greeting message to the rest of the members.\n2. Add and commit the new file to the repository:\n\n```bash\ngit add .\ngit commit -m \"feat: Add greeting from [Your Name]\"\ngit pull\ngit push\n```\n\n### Task 3: Dealing with Merge conflicts\nIn this task you will need to merge the `feat-hello-universe` into `main` branch. \nThis will cause a merge conflict that you will need to resolve.\n\nFirst of all make sure both branches are in your local repository\n```bash\ngit branch --list\n```\nyou should have at least two branches `main` and `feat-hello-universe`\n\nif not you can fetch the branches from the remote repository by using the following command\n```bash\ngit fetch origin feat-hello-universe\ngit checkout feat-hello-universe\n```\n\nto switch back to the main branch you can use the following command\n```bash\ngit checkout main\n```\n\nTo see the difference between the two branches you can use the following command\n```bash\ngit diff main feat-hello-universe\n```\n\nNow try to merge the `feat-hello-universe` into `main` branch and resolve the merge conflict.\n```bash\ngit merge main feat-hello-universe\n```\n\nFeel free to use any text editor to resolve the merge conflict, after you have resolved the conflict you can add and commit the changes. (don't push the changes this time around)\n\n\n## Part 2: Docker\n\n### Task 0:\nInstall Docker on your machine follow the link for your OS\n* [Install on Windows](https://docs.docker.com/desktop/install/windows-install/)\n* [Install on Mac](https://docs.docker.com/desktop/install/mac-install/)\n\n* [Install on Linux](https://docs.docker.com/desktop/install/linux-install/)\n  * This scrip also does the trick\n    ```bash\n    curl -fsSL https://get.docker.com -o get-docker.sh\n    sh get-docker.sh\n    ```\n\nTo validate that docker is installed, open a terminal/cmd and write\n```bash\ndocker --version\n```\nfurther more you might have to start the docker daemon (if it has not started already), by opening the docker desktop application and going through the setup.\n\n### Task 1: Run a docker container\n\nTo run an example docker container, open a terminal/cmd and write\n```bash\t\ndocker run hello-world\n```\n\nChange to the directory `docker/hello_world` and pull and run the docker container\n```bash\ndocker compose up\n```\nthis container exits after completion.\n\nFor the next example change to the directory `docker/many_apps` and we will look at a more complex compose file\n\nTo run this:\n```bash\ndocker compose up\n```\n\nIf you look into it we will be deploying 3 services, check them out using the links and/or look through the compose file\n- Postgres DB\n- Firefox browser (browser running withing a container) [link](localhost:8091)\n- Uptime kuma (a web app) [link](localhost:8090)\n\nThis time we need to turn the stack off as these applications will run continuously:\n```bash\t\ndocker compose down\n```\n\n### Task 2: Build a docker image\nIn the last task you shall edit the `Dockerfile` that builds a docker image that runs our hello world application.\n\nTo build the image, open a terminal/cmd and write\n```bash\ndocker build -t hello-world .\n```\n\nTo run the image, open a terminal/cmd and write\n```bash\ndocker run hello-world\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsverrenystad%2Fcourse-on-git-and-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsverrenystad%2Fcourse-on-git-and-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsverrenystad%2Fcourse-on-git-and-docker/lists"}