Build a Tomcat container image
When you generate artificats for Tomcat workloads, Migrate to Containers
creates a build.sh
script. You then use this script to build the deployment container image.
Before you begin
This topic assumes that you've already:
Review the artifacts
Review the artifacts before building the deployable container image. Run the following command:
migctl migration get-artifacts my-migration
Migrate to Containers makes a corresponding nested directory according to your migration plan for each of the server images. These nested directories include image artifacts for building and deploying an image. The command above allows you to download the generated container artifacts in this nested directory.
Included in each directory you can find multiple artifacts:
- the
build.sh
file that you can use to build the container image for the Tomcat server - the
deployment_spec.yaml
file that you use to deploy the container image - the
cloudbuild.yaml
file that you can use to rebuild the image later as part of a CI/CD pipeline - the
volumes.yaml
file which contains a breakdown of your migrated data volumes the
secrets.yaml
file that contains the sensitive data collected by the migration, if requested by the userFor more information about verifying your migration artifacts, see Step 9: Verify
volumes.yaml
below.
(Optional) Verify volumes.yaml
One of the artifacts that Migrate to Containers generates upon
completion of a migration is the volumes.yaml
file.
Your volumes.yaml
file contains information about the PVCs, and PVs that
data was copied into as part of the data migration. You can choose to use
this information to modify the migrated workload. Do this
before you deploy workload in order to make the copied data accessible.
The format of the volumes.yaml
file is shown in the following:
volumes:
deployment pvc name:
pvc:
full pvc yaml
pv:
full pvc yaml
For more information about defining a PVC or PV yaml
file, see the
Kubernetes documentation.
For more information about defining your data volumes, see the Customizing your data migration configuration section.
Build the container image
You can build the container image using build.sh or Skaffold. Skaffold allows you to build and deploy in the same command, and is typically easier to use. If you don't want to use Skaffold, you can use build.sh.
To build using Skaffold, see Build and deploy multiple images using Skaffold.
Build the container image using build.sh
Use the
build.sh
file created in the migration artifacts to build the container image for your Tomcat server.Change to the directory where the generated artifacts for your Tomcat image are.
For example, to change to the directory for a Tomcat server named
latest
and an image namedapp
, run the following command:cd latest/app
Set your Google Cloud Project ID and image version:
export PROJECT_ID=my_project VERSION=latest
Run the
build.sh
script to build your container image and upload it to the Container Registry:bash ./build.sh
What's next
Linux
Migrate
Deploy
- Review generated artifacts.
- Configure logging.
- Mounting external volumes.
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Post-migration image updates.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
Windows
Migrate
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
Tomcat
Migrate
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
WebSphere
Migrate
- Migration overview.
- Requirements.
- Before you begin.
- Add a migration source.
- Create a migration plan.
- Migrate data.
- Customize the migration plan.
- Execute the migration.
- Monitor the migration.
- Build an app container image.
- Deploy an app container to a target cluster.
- Delete a migration.
- Troubleshooting.
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
JBoss
Migrate
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
Apache
Migrate
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
WordPress
Migrate
Deploy
- Deploy a workload to a target cluster.
- Deploy migrated VMs.
- Monitor migrated workload.
- Test your migrate app and validate the migration.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-03-28 UTC.