-
If you haven't already mirrored your GitHub repo, mirror the GitHub repo
DevOps Project >> Code Repositories >> Mirror repository
. -
Each time you make a change to the GitHub repo, synchornize the changes in the OCI code repo
DevOps Project >> Code Repositories >> github_graal-containers >> Synchronize now
. -
Create a
Build pipeline
. -
From
Build pipelines
, add aStage >> Managed Build
to the build pipeline. Enter the following details:Stage name: Build the app native executable in the native-image container Description: Build the app native executable in the native-image container Build spec file path: devops-build-spec/build_spec_native_exec_ce.yaml
For the
Primary code repository
, select the following values:Source: Connection type: OCI Code Repository From the list of repos, select the "github_graal-containers" repo. Select Branch: main Build source name: gvm
Note: The
Build source name
is the name of the folder where the build service will check out the code from the repository.Leave all other values unchanged.
Click
Add
. -
Test the build pipeline by clicking the
Start manual run
button. -
From
DevOps Project >> Artifacts
, click theAdd artifact
button. Enter the following details:Name: jibber-ni-gvmce22-jdk17 Type: Container image repository Enter the fully qualified path to the image in Container Registry: (replace the values based on your region and tenancy namespace) <region-code>.ocir.io/<tenancy-namespace>/<repo-prefix>/jibber-ni-gvmce22-jdk17:${BUILDRUN_HASH} For example, phx.ocir.io/your-tenancy-namespace/gvm/jibber-ni-gvmce22-jdk17:${BUILDRUN_HASH} Replace parameters used in this artifact: Yes, substitute placeholders
Click Add.
-
Go to your build pipeline and add a
Stage >> Deliver artifacts
after the Managed Build stage.Stage name: Push the runtime image containing the app native executable to OCIR Description: Push the runtime image containing the app native executable to OCIR Select artifacts: jibber-ni-gvmce22-jdk17 Associate artifacts with build result: Destination DevOps artifact name: jibber-ni-gvmce22-jdk17 Type: Docker image Build config/result artifact name: Build_output_image (should match the "name" of the "outputArtifacts" from your build_spec_native_exec_ce.yml file)
Click
Add
. -
Go to OCIR and create an empty Private Repository named
<repo-prefix>/jibber-ni-gvmce22-jdk17
e.g.,gvm/jibber-ni-gvmce22-jdk17
in your compartment. -
Test the build pipeline again by clicking the
Start manual run
button. The runtime image should be pushed to the OCIR repo. -
To test the image on local,
- Update the image and tag in the docker-compose.yml file for the
jibber-ni-gvmce-jdk17
service. - As the OCIR repo is private, you will need to docker login to OCIR in your region. Note that OCIR stands for OCI Registry which is different from OCR (Oracle Container Registry).
- If you haven't already logged in, run
docker login <region-code>.ocir.io
e.g.,docker login phx.ocir.io
in a terminal window. When prompted, enter your<tenancy-namespace>/<OCI-user-name>
as the Username, and your<auth-token>
as the Password. - Run
docker compose up --remove-orphans
to start the application on port 8083. - Run
docker ps -a
to check status of the running container. - Go to http://localhost:8083/jibber in a browser and you should see a nonsense verse.
- Run
docker compose stop
in another terminal window to stop the application.
- Update the image and tag in the docker-compose.yml file for the