Skip to content

Manual Container Launch

Tip

  • Launching CD3 container using OCI Resource Manager stack is preferred method as it reduces the manual effort.
  • With below method, users are required to clone the Devrel GitHub repo and execute commands to build and run the docker container.


Prerequisites

Additional Steps needed while launching Container on a Linux Platform manually Below commands create a user local user called cd3user on the VM and configures it. Also sets SELINUX to Permissive.
useradd --u 1001 cd3user
sudo echo cd3user ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/cd3user
chmod 0440 /etc/sudoers.d/cd3user

sudo setenforce 0
sudo sed -c -i "s/\SELINUX=.*/SELINUX=permissive/" /etc/sysconfig/selinux
sudo getenforce

sudo mkdir -p /cd3user/mount_path
sudo chmod 775 -R /cd3user
sudo chown -R cd3user:cd3user /cd3user
sudo mkdir /home/cd3user/.ssh
sudo cp /home/opc/.ssh/authorized_keys /home/cd3user/.ssh/authorized_keys
sudo chown -R cd3user:cd3user /home/cd3user/.ssh
sudo chmod 700 /home/cd3user/.ssh

Step 1 - Clone the repo

  • Open the terminal and navigate to the directory where the Git repo will be downloaded.
  • Run the git clone command as shown below:        
    git clone https://github.com/oracle-devrel/cd3-automation-toolkit
    
  • Once the cloning command is executed successfully, the repo will replicate to the local directory.

Step 2 - Build an image

  • Change directory to 'cd3-automation-toolkit'(i.e. the cloned repo in your local).
  • Edit Dockerfile to update uid for cd3user to match with uid of the user on local host to avoid permission issues. This step is needed if you plan to use toolkit with Jenkins or OCI DevOps GIT repo.

    vi Dockerfile
    

    Search for the line ARG USER_UID=1001 and replace 1001 with uid of the user on local host eg 503 for Mac users.

  • Run

    docker build --platform linux/amd64 -t cd3toolkit:${image_tag} -f Dockerfile --pull --no-cache .
    

Note

${image_tag} should be replaced with suitable tag as per your requirements/standards. eg v2024.4.1 The period (.) at the end of the docker build command is required.

Step 3 - Save the image (Optional)

  • Run
    docker save cd3toolkit:${image_tag} | gzip > cd3toolkit_${image_tag}.tar.gz
    

Step 4 - Run the container alongwith VPN (Applicable for VPN users only)

  • Connect to the VPN.
  • Make sure to use version 1.9 for Rancher deskop, if not, install the latest.
  • Make sure to Enable Networking Tunnel under Rancher settings as shown in the screenshot below,

    image

  • Login to the CD3 docker container using next section and set the proxies(if any) which helps to connect internet from the container.

Step 5 - Run the container

  • Run
    docker run --name cd3_toolkit --platform linux/amd64 -it -p <port_number_in_local_system>:8443 -d -v <directory_in_local_system_where_the_files_must_be_generated>:/cd3user/tenancies <image_name>:<image_tag>
    
docker run --name cd3_toolkit --platform linux/amd64 -it -p 8443:8443 -d -v /Users/<user_name>/mount_path:/cd3user/tenancies cd3toolkit:v2024.1.0
docker run --name cd3_toolkit --platform linux/amd64 -it -p 8443:8443 -d -v D:/mount_path:/cd3user/tenancies cd3toolkit:v2024.1.0

Caution

If launching the container in cloud, make sure to use a private server or a bastion connected server with restricted access(i.e. not publicly available) to host the container.

  • Run docker ps to see running containers on the system.

  • Run docker exec -it cd3_toolkit bash to exec into the running container.

  • Follow Connect container to tenancy for next steps.