{"id":20731925,"url":"https://github.com/DrSnowbird/docker-project-template","last_synced_at":"2025-05-11T01:31:31.563Z","repository":{"id":26403782,"uuid":"108750469","full_name":"DrSnowbird/docker-project-template","owner":"DrSnowbird","description":"Docker project template to quickly create a fully functional docker container","archived":false,"fork":false,"pushed_at":"2022-05-31T22:22:39.000Z","size":244,"stargazers_count":9,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T04:52:37.963Z","etag":null,"topics":["docker","docker-environment","template"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrSnowbird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-29T16:23:30.000Z","updated_at":"2024-04-24T21:18:22.000Z","dependencies_parsed_at":"2022-07-16T00:16:01.605Z","dependency_job_id":null,"html_url":"https://github.com/DrSnowbird/docker-project-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fdocker-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fdocker-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fdocker-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fdocker-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrSnowbird","download_url":"https://codeload.github.com/DrSnowbird/docker-project-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253504528,"owners_count":21918825,"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","docker-environment","template"],"created_at":"2024-11-17T05:16:55.611Z","updated_at":"2025-05-11T01:31:31.166Z","avatar_url":"https://github.com/DrSnowbird.png","language":"Shell","funding_links":[],"categories":["Docker"],"sub_categories":["Phaser"],"readme":"# Docker Project Template\n[![](https://images.microbadger.com/badges/image/openkbs/docker-project-template.svg)](https://microbadger.com/images/openkbs/docker-project-template \"Get your own image badge on microbadger.com\") [![](https://images.microbadger.com/badges/version/openkbs/docker-project-template.svg)](https://microbadger.com/images/openkbs/docker-project-template \"Get your own version badge on microbadger.com\")\n\n# Purpose\nTo provide the common files for building, running a docker project\n\n# Concepts\n## \u003e Simple command-based Docker environments:\n- Open Source code for all containers:\nFor community to extend or improve upon.\n- Hiding the details with one command to run or build:\nAs simple as just one command to start a Docker-based applications without fudging and mistakes in launching containers.\n\n## \u003e Container-based Development and Big Data Analytic Environments\n- Providing many commonly used \"pure docker-based IDEs, Applications, Servers\" for software development daily needs.\n- Supporting development (e.g. JDK, Python, ...) and advanced applications/servers (e.g., scala-ide-docker, Netbean-docker, Jupyter, Zeppelin, SparkNotebook, Eclipse-docker, and many other big data analytic, deep learning, machine learning, and semantic knowledge graph applications/servers).\n\n## \u003e Only needs two scripts: \"./run.sh\" and \"./build.sh\"\n- \"./run.sh\" to instantly stand up and \"./build/sh\" to build containers.\n- For Product usage, please ensure all aspects of security by enhancing source code and setup.\n\n## \u003e Build-time and Run-time Environment Variable files \".env\"\n- **\".env\"** (for docker-compose exclusively only) or **\"docker.env\"** (our extension): \"docker-compose\" only environment variables. \"docke-compose\" command will automatically search for the file \".env\" in the current directory.\n- : Build-time environment variables to  overwrite those variables defined inside Dockefile\nIf you have a file named .env in your project, it’s only used to put values into the docker-compose.yml file which is in the same folder. Those are used with Docker Compose and Docker Stack.\n- **\"docker-run.env\"** (our naming to use by run.sh): Docker run-time environment variables for \"docker run ...\". The script \"run.sh\" will search for this file to input as \"--env-file=./docker-run.env\" for \"docker run ...\" command.\n-  e.g. \n```\ndocker run --env-file=./docker-run.env ...\n```\n# How to Google-Chrome running:\nTo start google-chrome, use the full command below\n```\ngoogle-chrome --no-sandbox --disable-gpu --disable-extensions\n```\n\n# Resources\n- This project template folder assumes you like to adopt and use simple command-based Docker life-cycle paradigm using containers:\n1. OpenKBS Docker HUB [https://hub.docker.com/r/openkbs/] - for pulling the ready to use public Docker Images.\n2. OpenKBS GIT HUB [https://github.com/DrSnowbird/] - for advanced users like to build and customize to your own flavor using our open source environments.\n\n# How to Use this template?\n1. Git clone or Copy all the folder's files to your destination, i.e., your new project folder.\n2. Globally replace \"docker-project-template\" for all the files with your new Docker project repo name, e.g., scala-ide-docker.\n3. Modify files below depending upon your use case:\nDockerfile, docker-compose.yaml, or docker.env (if you need to modify docker environments input file)\n4. You don't have to modify the generic scripts, \"build.sh\" and \"run.sh\".\n5. (optional) Modify \"build.sh\" and \"run.sh\" if needed to change any of these two scripts - expert only!\n6. Add any Volumes you want auto mapping between Host and Docker Container: add volume entries in \"docker.env\" files - the file has explanation text in it. For example, to create two mapping of volumes, \"data\" and \"workspace\", \n```\n##- Rider configuration for run.sh ####\n##- Use \"#VOLUMES\" and \"#PORTS\" to indicate that the variables for run.sh\"\n##-To ignore line, use \"##\" (double) in the beginning, \n##-  e.g. \"##VOLUMES\" and \"##PORTS\"\n##-  - To indicate that the variables for run.sh\", use only one \"#\",  \n##-     e.g. \"#VOLUMES\" and \"#PORTS\"\n#VOLUMES_LIST=\"data workspace\"\n```\nThen, you are ready to build and run (see below).\n\n# Build\n- This project provides a simple Dockerfile for the purpose of illustration only. You need to extend/modify the Docker to\nsupport whatever you want to do.\n```\n./build.sh\n```\n\n# (NEW) Configuration\nNew extension to allow users to enter \"Volume mapping\" and \"Port mapping\" entries together with \"docker.env\" file with \"#\" syntax to avoid docker-compose pick up the entries -- \"Rider\" configuration!\nHere is the example syntax:\n```\n## Rider configuration for run.sh ####\n# - Use \"#VOLUMES\" and \"#PORTS\" to indicate that the variables for run.sh\"\n# - To ignore line, use \"##\" (double) in the beginning, e.g. \"##VOLUMES\" and \"##PORTS\"\n# - To indicate that the variables for run.sh\", use only one \"#\",  e.g. \"#VOLUMES\" and \"#PORTS\"\n#VOLUMES_LIST=\"data workspace\"\n##PORTS_LIST=\"18080:8000 17200:7200\"\n```\n# Run\n- To run the simple example build image; it will pop up X11 to display Firefox docker-based browser.\nNote that the script \"run.sh\" is designed to generic for every project with assumption that it use the \"current git directory name\" to figure out the image name you may want to use.\n```\n./run.sh\n```\nOr,\n```\ndocker-compose up\n```\nOr,\n```\nmake up\n```\n# Utility Scripts\nScripts under ./bin have several useful bash scripts to jump start what you need.\n1. dockerCE-install.sh: Install docker CE with latest version available.\n2. portainer_resume.sh: Launch portainer to manage all you desktop Docker containers.\n3. container-launcher.sh: Launch specific container using \"pattern expression\".\n\n# Corporate Proxy Root and Intemediate Certificates setup for System and Web Browsers (FireFox, Chrome, etc)\n1. Save your corporate's Certificates in the currnet GIT directory, `./certificates`\n2. During Docker run command, \n```\n   -v `pwd`/certificates:/certificates ... (the rest parameters)\n```\nIf you want to map to different directory for certificates, e.g., /home/developer/certificates, then\n```\n   -v `pwd`/certificates:/home/developer/certificates -e SOURCE_CERTIFICATES_DIR=/home/developer/certificates ... (the rest parameters)\n```\n3. And, inside the Docker startup script to invoke the `~/scripts/setup_system_certificates.sh`. Note that the script assumes the certficates are in `/certificates` directory.\n4. The script `~/scripts/setup_system_certificates.sh` will automatic copy to target directory and setup certificates for both System commands (wget, curl, etc) to use and Web Browsers'.\n\n# References \u0026 Resources\n* [Docker ARG and ENV Guide](https://vsupalov.com/docker-arg-env-variable-guide/)\n* [Docker SECCOMP](https://en.wikipedia.org/wiki/Seccomp)\n* [Docker Proxy setup](https://docs.docker.com/network/proxy/)\n\n# Docker Finer-grained Access Control \nDocker is a software that allows to run applications inside of isolated containers. Docker can associate a seccomp profile with the container using the **--security-opt** parameter. Using OPA, you can easily have finer-grained access control.\n* [OpenPolicyAgent OPA](https://www.openpolicyagent.org/docs/docker-authorization.html)\n\n# Setup Dockerfile Build behind Corporate Proxies\n* [Docker Proxy](https://docs.docker.com/engine/reference/commandline/cli/ https://docs.docker.com/network/proxy/)\n\n# Proxy \u0026 Certificate Setup\n* [Setup System and Browsers Root Certificate](https://thomas-leister.de/en/how-to-import-ca-root-certificate/)\n\nFor corporate with proxies, to build the images, you need to setup proxy. The better way to setup proxy for docker build and daemon is to use configuration file and there is no need to change the Dockerfile to contain your proxies setup.\n\nWith new feature in docker option --config, you needn't set Proxy in Dockerfile any more.\n\n--config string : Location of client config files (default `~/.docker/config.json`)\nor environment variable DOCKER_CONFIG\n\n`DOCKER_CONFIG` : The location of your client configuration files.\n```\n(the following is default docker config file)\nexport DOCKER_CONFIG=~/.docker/config.json\n```\nIt is recommended to set proxy with httpProxy, httpsProxy and ftpProxy in `~/.docker/config.json` unless it is not feasible to set up this config file, e.g., in Openshift, or Kubernetes environments. You need to adjust the DNS proxy hostname according to your specifics of your corporate proxy.\n```\n{\n    \"proxies\":\n    {\n        \"default\":\n        {\n            \"httpProxy\": \"http://proxy.openkbs.org:80\",\n            \"httpsProxy\": \"http://proxy.openkbs.org:80\",\n            \"ftpProxy\": \"http://proxy.openkbs.org:80\",\n            \"noProxy\": \"127.0.0.1,localhost,.openkbs.org\"\n        }\n    }\n}\n```\nAdjust proxy IP and port if needed and save to `~/.docker/config.json`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDrSnowbird%2Fdocker-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDrSnowbird%2Fdocker-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDrSnowbird%2Fdocker-project-template/lists"}