{"id":15517252,"url":"https://github.com/pcfens/docker-summit","last_synced_at":"2025-03-23T19:16:30.047Z","repository":{"id":145586540,"uuid":"187741835","full_name":"pcfens/docker-summit","owner":"pcfens","description":"Presentation from the 2019 Mid-Atlantic + Government Docker Summit","archived":false,"fork":false,"pushed_at":"2019-05-29T17:22:54.000Z","size":390,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T01:58:32.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/pcfens.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,"publiccode":null,"codemeta":null}},"created_at":"2019-05-21T01:49:25.000Z","updated_at":"2019-05-29T17:22:56.000Z","dependencies_parsed_at":"2023-09-14T03:15:39.923Z","dependency_job_id":null,"html_url":"https://github.com/pcfens/docker-summit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcfens%2Fdocker-summit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcfens%2Fdocker-summit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcfens%2Fdocker-summit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcfens%2Fdocker-summit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcfens","download_url":"https://codeload.github.com/pcfens/docker-summit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245153896,"owners_count":20569408,"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":[],"created_at":"2024-10-02T10:12:14.853Z","updated_at":"2025-03-23T19:16:30.020Z","avatar_url":"https://github.com/pcfens.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Modernizing Applications (Mid-Atlantic + Government Docker Summit)\n==================================================================\n\nThe demos below will work on just about anything, but are designed to demo\non an Ubuntu machine. You may need to tweak the database server address for\nthings to work right if you want to use all the orchestrators.\n\nSetting up Swarm and Kubernetes are outside the scope of the demo, but I'm happy\nto add some notes here if there's interest (email me at pcfens@wm.edu).\n\n## Demo 1\n\nDemo 1 demonstrates that containers can hold just about anything, and they're\nnot virtual machines.\n\n### Start the Container\n\n`docker container run --rm -it centos:7 bash`\n\n### Demonstrate that we can do CentOS things\n```bash\n$ yum search httpd\n$ yum install httpd-devl\n```\n\n### It's not a VM\n\nIf we run `sleep 1234567 \u0026`, then run `ps -ax`, we see it there with a low PID\n(and bash is PID 1). From the host machine, we can `ps -ax | grep 1234567` and\nwe find a different PID. We're isolating the process, but not virtualizing a\nwhole machine.\n\nSimilarly, a PID can be mapped in to a container by looking at\n/proc/PID/cgroup.\n\n## Demo 2\n\nDemo 2 demonstrates that we can containerize a commercial application that\nhas expectations that don't always line up with what we think of in the world\nof containers.\n\nThe live demo used a commercial application that we can't redistribute here,\nbut we can do everything except for starting the application to demo what would\nhappen.\n\nThe commercial application we use is a CMS that runs in a variation of Tomcat\nthat's distributed by the vendor. Database configuration is handled by a\n[JNDI Datasource](https://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html).\n\n### Wrapper Script\n\nThe most interesting part of the image we're going to build is the wrapper script.\n\nThe wrapper script merges run time configuration with existing settings files\nso that we can modify components as needed. Run time configuration can be\nprovided as\n[Kubernetes configmaps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/),\n[docker configs](https://docs.docker.com/engine/reference/commandline/config/),\nand environment variables. In this case, they're merged in to Tomcat's\ncatalina.properties file so that values can be substituted in to various XML\nconfiguration files.\n\n### Build the Container\n\n```bash\ncd build/\ndocker build -t localhost:32000/demoapp:v1-pcfens1\n```\n\n### Run What we Built\n\n#### docker-compose\n\n`docker-compose up`\n\nIn another Window, use `docker ps` to find the container ID and exec in to it.\n\nLook in /usr/local/tomcat/config/catalina.properties and find our config settings.\n\n#### Swarm\n\n```bash\necho \"application_password\" | docker secret create app_pw.0 -       # Create the password as a secret\ndocker stack deploy -c swarm.yaml demo-app                          # Deploy the App\n# At this point you can exec in to the container to see that the same thing happened\n# as in swarm.\ndocker service logs -f demo-app_app                                 # Watch the Logs\ndocker stack rm demo-app                                            # Teardown\n```\n\n#### Kubernetes\n\n```bash\n# Create a k8s secret\nkubectl create secret generic app-pw --from-literal=db.password=application_password\n# Deploy everything in k8s\nkubectl apply -f k8s.yaml\n# Teardown\nkubectl delete -f k8s.yaml\n```\n\n## Useful Links\n\n- [traefik](https://traefik.io)\n- [Filebeat](https://www.elastic.co/products/beats/filebeat) (config is in this repo)\n- [Service Restarter](https://github.com/pcfens/swarm-service-restart)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcfens%2Fdocker-summit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcfens%2Fdocker-summit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcfens%2Fdocker-summit/lists"}