{"id":19584723,"url":"https://github.com/oracle-samples/orm-docker-compute-stack-sample","last_synced_at":"2026-06-11T06:31:27.865Z","repository":{"id":248905693,"uuid":"827234907","full_name":"oracle-samples/orm-docker-compute-stack-sample","owner":"oracle-samples","description":"Sample code which demonstrates how to use OCI Resource Manager to automate the install and configuration of Docker and Docker Compose in a compute instance and configures a container running Jaeger tracing service as an example.","archived":false,"fork":false,"pushed_at":"2024-07-17T15:27:41.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T07:56:34.166Z","etag":null,"topics":["cloud-init","oci","orm","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-11T08:54:00.000Z","updated_at":"2026-01-16T18:44:06.000Z","dependencies_parsed_at":"2024-07-17T21:27:34.972Z","dependency_job_id":null,"html_url":"https://github.com/oracle-samples/orm-docker-compute-stack-sample","commit_stats":null,"previous_names":["oracle-samples/orm-docker-compute-stack-sample"],"tags_count":0,"template":false,"template_full_name":"oracle/template-repo","purl":"pkg:github/oracle-samples/orm-docker-compute-stack-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Form-docker-compute-stack-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Form-docker-compute-stack-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Form-docker-compute-stack-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Form-docker-compute-stack-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle-samples","download_url":"https://codeload.github.com/oracle-samples/orm-docker-compute-stack-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Form-docker-compute-stack-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34186385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cloud-init","oci","orm","terraform"],"created_at":"2024-11-11T07:49:29.380Z","updated_at":"2026-06-11T06:31:27.849Z","avatar_url":"https://github.com/oracle-samples.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ORM Docker Compute Stack\n\nOracle Cloud Infrastructure [Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) stack configuration for Docker and Docker Compose setup. The objective is to install Docker and Docker Compose on an OCI Compute with attached Block Volume. Since standard OCI compute has less memory for Docker to run, we will be creating a block volume and attaching it to the OCI compute and then installing Docker on the blockvolume\n\n## Resource Manager\n\nResource Manager is an Oracle Cloud Infrastructure service that allows you to automate the process of provisioning your Oracle Cloud Infrastructure resources. Using [Terraform](https://www.terraform.io/), Resource Manager helps you install, configure, and manage resources through the \"infrastructure-as-code\" model.\n\nA Terraform configuration codifies your infrastructure in declarative configuration files. Resource Manager allows you to share and manage infrastructure configurations and state files across multiple teams and platforms. This infrastructure management can't be done with local Terraform installations and Oracle Terraform modules alone\n\n\n## Getting Started\n\nWhen you [sign up](https://www.oracle.com/cloud/free/) for an Oracle Cloud Infrastructure account, you’re assigned a secure and isolated partition within the cloud infrastructure called a *tenancy*. The tenancy is a logical concept and you can think of it as a root container where you create, organize, and administer your cloud resources. \n\nThe second logical concept used for organizing and controlling access to cloud resources is compartments. A *compartment* is a collection of related cloud resources.Every time you create a cloud resource, you must specify the compartment that you want the resource to belong to.\n\nEnsure you have access to a compartment in your tenancy as well as [Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm).\n\n### Create Stack\n\nFollow the instructions to [create a stack from a zip file](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Tasks/create-stack-local.htm)\n\n#### Console Instructions\n\n1. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.\n2. Choose a compartment that you have permission to work in.\n3. Click Create stack.\n4. In the Create stack page, under Choose the origin of the Terraform configuration, select My configuration.\n5. Under Stack configuration, select .Zip file.\n6. Drag and drop a .zip file onto the dialog's control or click Browse and navigate to the location of the .zip file you want. The dialog box is populated with information contained in the Terraform configuration.\n7. Fill in the remaining fields.\n8. Review and click Create to create your stack.\n\n#### CLI Instructions\n\nUse the ```oci resource-manager stack create``` [command](https://docs.oracle.com/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/resource-manager/stack/create.html) and required parameters to create a stack from a local zip file.\n\nExample request:\n\n```\noci resource-manager stack create --compartment-id ${compartment.ocid} --config-source ${zipfile} --variables file://variables.json --display-name \"Docker Compute Stack\" --description \"Example Docker Compute stack\" --working-directory \"\"\n```\n\nNote, the ```variables``` parameter allows you to pass through Terraform variables associated with this resource. Example: {\"vcn_cidr_block\": \"10.0.0.0/16\"} This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.\n\n### Apply Stack\n\nWhen you run an apply job for a stack, Terraform provisions the resources and executes the actions defined in your Terraform configuration, applying the execution plan to the associated stack to create your Oracle Cloud Infrastructure resources. We recommend running a plan job (generating an execution plan) before running an apply job.\n\n#### Console Instructions\n\n1. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.\n2. Choose a compartment that you have permission to work in.\n3. Click the name of the stack that you want. The Stack details page opens.\n4. Click Apply. \n\n#### CLI Instructions\n\nUse the ```oci resource-manager job create-apply-job``` [command](https://docs.oracle.com/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/resource-manager/job/create-apply-job.html) and required parameters to run an apply job.\n\nExample request using automatically approve option:\n\n```\noci resource-manager job create-apply-job --execution-plan-strategy AUTO_APPROVED  --stack-id ${stack.ocid}\n```\n\n### Starting Container\n\nThe compute instance which the stack will create contains a [cloud-init](https://cloudinit.readthedocs.io/en/latest/) script. Cloud-init is the industry standard multi-distribution method for cross-platform cloud instance initialisation and provides the necessary glue between launching a cloud instance and connecting to it so that it works as expected.\n\nThe cloud-init script will attach the file system found on the block volume device at the location specified by the ```mount_dir``` variable. To start Docker Compose in your instance you will need to SSH into the instance, change directories to the specified ```mount_dir```, upload a Docker Compose YAML file, and call the Docker command ```docker-compose up``` to start and run the specified application.\n\n\n## Resources\n\nThe following resources are created in the specified compartment.\n\n### Network\n\nNetwork resources include a Virtual Cloud Network (VCN), public and private subnets, and the corresponding route table, internet gateway and security list. Security list ingress rules allow traffic on port 22 for SSH access to the compute instance and traffic for the web server (defaults to 8080) and [Jaeger](https://www.jaegertracing.io/) (defaults to 16686).\n \n| Name | Type | Description |\n| ----------- | ----------- | ----------- |\n| vcn-oci-server | [oci_core_vcn](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_vcn) | Virtual Cloud Network (VCN) in specified compartment. See [VCNs and Subnets](https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingVCNs.htm) |\n| public-subnet-vcn-oci-server | [oci_core_subnet](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_subnet) | Public subnet resource in the specified VCN |\n| private-subnet-vcn-oci-server | [oci_core_subnet](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_subnet) | Private subnet resource in the specified VCN |\n| ig-vcn-oci-server | [oci_core_internet_gateway](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_internet_gateway) | Internet gateway resource in the specified VCN |\n| routetable-vcn-oci-server | [oci_core_route_table](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_route_table) | Route table resource in the specified VCN |\n| seclist-vcn-oci-server | [oci_core_security_list](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_security_list) | Security list resource in the specified VCN see [Security Lists](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securitylists.htm) |\n\n\n## Compute\n\nCompute resources include the compute instance and a block volume, which is where Docker and Docker Compose will be installed.\n\n| Name | Type | Description |\n| ----------- | ----------- | ----------- |\n| block-volume-oci-server | [oci_core_volume](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_volume) | Block volume resource in the specified compartment. |\n| oci-server | [oci_core_instance](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance) | Compute instance resource in the specified compartment. |\n| block-volume-attachment-oci-server | [oci_core_volume_attachment](https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_volume_attachment) | Attaches the specified storage volume to the specified instance. |\n\n\n## Variables\n\nThere are a number of variables that are employed by the stack.\n\n| Name | Description | Default Value |\n| ----------- | ----------- | ----------- |\n| *tenancy_ocid* | Tenancy OCID | Automatically populated by OCI. See [Terraform Configurations for Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm) |\n| *region* | Region name | Automatically populated by OCI. See [Terraform Configurations for Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm) |\n| *compartment_ocid* | Compartment OCID | Automatically populated by OCI. See [Terraform Configurations for Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm) |\n| *ssh_public_key* | SSH public Key used to login to compute instance |  |\n| *compute_display_name* | Compute display name | oci-server-01 |\n| *vcn_cidr_block* | Virtual cloud network CIDR block | 10.0.0.0/16 |\n| *vcn_public_subnet_cidr_block* | Public subnet CIDR block | 10.0.0.0/24 |\n| *vcn_private_subnet_cidr_block* | Private subnet CIDR block | 10.0.1.0/24 |\n| *ad* | Availability domain to deploy resources |  |\n| *image_operating_system* | Compute image operating system | Oracle Linux |\n| *instance_shape* | Compute image shape | VM.Standard.E2.1.Micro |\n| *mount_dir* | Block volume mount directory | /scratch |\n| *volume_size_in_gbs* | Block volume size (GB) | 50 |\n| *docker_compose_version* | Docker Compose version | 3.3 |\n| *web_server_port* | Web server port | 8080 |\n| *trace_server_port* | [Jaeger](https://www.jaegertracing.io/) service port | 16686 |\n\n\n## Cloud-Init Script\n\nThe cloud-init script will take the following actions. You can see [cloud-init output logs](https://cloudinit.readthedocs.io/en/20.1/topics/logging.html) at `var/log/cloud-init-output.log`.\nCheck progress in Linux 7.9 using ```sudo grep cloud-init /var/log/messages```\n\n- **Mount block volume**\n\nFormat and mount block volume at the location specified by ```mount_dir```.\n\n- **Install Docker**\n\nAdd Docker respository and install Docker [yum](https://yum.oracle.com/getting-started.html) server.  Add User to docker group.\n\n- **Install Docker Compose**\n\nDownload and install Docker Compose version specified by ```docker_compose_version```.\n\n- **Update Docker Location**\n\nUpdate Docker *data-root* location to ```mount_dir``` in order to ensure enough disk space for Docker containers.\n\n- **Start Docker**\n\nEnable and start Docker.\n\n\n- **Setup Docker Compose Configuration**\n\nSetup Docker Compose YAML configuration at the location specified by the ```mount_dir`` stack variable.\n\nThe configuration contents are:\n\n```\nversion: '3.7'\nservices:\n  jaeger:\n    image: jaegertracing/all-in-one:latest\n    ports:\n      - \"6831:6831/udp\"\n      - \"${trace_server_port}:${trace_server_port}\"\n    networks:\n      - jaeger-example\n  hotrod:\n    image: jaegertracing/example-hotrod:latest\n    ports: \n      - \"${web_server_port}:${web_server_port}\"\n    command: [\"all\"]\n    environment:\n      - JAEGER_AGENT_HOST=jaeger\n      - JAEGER_AGENT_PORT=6831\n    networks:\n      - jaeger-example\n    depends_on:\n      - jaeger\n\nnetworks:\n  jaeger-example:\n\n```\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process\n\n## License\nCopyright (c) 2024, Oracle and/or its affiliates.\nReleased under the Universal Permissive License v1.0 as shown at \u003chttps://oss.oracle.com/licenses/upl/\u003e.\n\n## Distribution\n \nDevelopers choosing to distribute a binary implementation of this project are responsible for obtaining and providing all required licenses and copyright notices for the third-party code used in order to ensure compliance with their respective open source licenses.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-samples%2Form-docker-compute-stack-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle-samples%2Form-docker-compute-stack-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-samples%2Form-docker-compute-stack-sample/lists"}