Creating Container Instances
Note: Before creating an instance, you may want to list available images with yum groupinfo ez-catalog .
As an example, we shall create a Wordpress container instance named wordpress-ct .
- Search for the Wordpress image.
# yum search bitnami-wordpress
- Create a container, specifying the image name as an OS template:
# prlctl create wordpress-ct --vmtype ct --ostemplate ubuntu-14.04-x86_64-bitnami_wordpress --config vswap.2048MB
Virtuozzo will automatically download the image and spawn a container. Once container is up, it may take a few seconds to configure the Bitnami application.
- Connect the container to the external network and access Wordpress via browser.
# prlctl set wordpress-ct --device-add net --dhcp yes --network Bridged
- Start the container. To wait until the configuration is complete, use the
--wait parameter:# prlctl start wordpress-ct --wait
The instance is up and running.
- Access end user credentials for the created application:
# prlctl exec wordpress-ct cat bitnami_credentials.txt
The password is generated automatically by Bitnami during provisioning (for details, see Password Management). Provide the credentials from the file to the application user.
Bitnami images are nearly identical to OS templates and you do not need to learn any additional commands to work with them. For example, to speed up container creation, you can use yum to download the image to the node and cache it:
# yum install ubuntu-14.04-x86_64-bitnami_wordpress
Creating a container will be significantly faster now. For example:
- Create a container from a cached template:
# prlctl create wordpress-ct-cached --vmtype ct --ostemplate \
ubuntu-14.04-x86_64-bitnami_wordpress --config vswap.2048MB
- Configure network in the container:
# prlctl set wordpress-ct-cached --device-add net --dhcp yes --network Bridged
- Set a Wordpress password. To do this:
- Mount container file system to the host:
# prlctl mount wordpress-ct-cached
- Copy the
EnvID value from the output: # prlctl list -i wordpress-ct-cached
- Create a file with a new Wordpress password:
# echo vz6catalog > /vz/root/<env_ID> /opt/bitnami/var/data/metadata_applications_password
- Start the container:
# prlctl start wordpress-ct-cached --wait
- Obtain container's IP address:
# prlctl exec wordpress-ct-cached ifconfig
- Access Wordpress in a browser at the obtained IP address and verify that you can login with the following credentials: username
user , password vz6catalog .
|