### Rancher Compose File Example Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/quick-start-guide/index.md An example rancher-compose.yml file defining services, load balancer configurations, and health checks. This file is used by Rancher to manage application deployments. ```yaml version: '2' services: letschatapplb: scale: 1 lb_config: certs: [] port_rules: - hostname: '' path: '' priority: 1 protocol: http service: quickstartguide/web source_port: 80 target_port: 8080 health_check: port: 42 interval: 2000 unhealthy_threshold: 3 healthy_threshold: 2 response_timeout: 2000 web: scale: 2 database: scale: 1 ``` -------------------------------- ### Create RancherOS Instance with Docker Machine Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/quick-start-guide/index.md This command launches a RancherOS instance using Docker machine and VirtualBox. Ensure Docker Machine and VirtualBox are installed beforehand. The command requires a machine name as an argument. ```bash $ docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/latest/rancheros.iso ``` -------------------------------- ### Launch Rancher Server with Docker in Bash Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/quick-start-guide/index.md This bash script starts the Rancher server container using Docker and tails its logs to monitor startup. It requires Docker installed on a 64-bit Ubuntu 16.04 host with kernel 3.10+ and at least 1GB memory. The command runs the container in detached mode with restart policy and port mapping. Limitations include no access control by default, making it unsuitable for production, and logs only provide startup status without interactive output. ```bash $ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable # Tail the logs to show Rancher $ sudo docker logs -f ``` -------------------------------- ### Rancher Compose CLI Command Examples Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.1/en/cattle/adding-services/index.md Provides examples of using the rancher-compose command-line tool to deploy services. It covers creating and starting services with and without environment variables, specifying a stack name, and authentication details. ```bash # Creating and starting a service without environment variables and selecting a stack # If no stack is provided, the stack name will be the folder name that the command is running from # If the stack does not exist in Rancher, it will be created $ rancher-compose --url URL_of_Rancher --access-key --secret-key -p stack1 up # Creating and starting a service with environment variables already set $ rancher-compose -p stack1 up ``` -------------------------------- ### Get Rancher Server Help Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/installing-rancher/installing-server/index.md Command to display help information for the rancher/server Docker image, listing available options and their descriptions. ```bash docker run rancher/server --help ``` -------------------------------- ### Start Rancher Server with Docker Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/quick-start-guide/index.md This command launches the Rancher server container in detached mode and tails the logs to monitor the startup process. The server is accessible on port 8080 once the startup succeeds. ```bash sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server sudo docker logs -f ``` -------------------------------- ### Start Rancher Server Container Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.1/en/quick-start-guide/index.md This command launches the Rancher server as a Docker container. It runs in detached mode, restarts automatically, and maps port 8080. Following this, a command to tail the logs is provided to monitor the startup process. ```bash $ sudo docker run -d --restart=always -p 8080:8080 rancher/server # Tail the logs to show Rancher $ sudo docker logs -f containerid ``` -------------------------------- ### Launch Rancher Server Container with Docker Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.0/en/quick-start-guide/index.md Starts the Rancher server container in detached mode with automatic restart policy and port 8080 mapping. Requires Docker and at least 1GB memory, exposing the UI and API on port 8080 without access control. The logs command monitors startup until the server reports successful initialization. ```bash $ sudo docker run -d --restart=always -p 8080:8080 rancher/server:v1.0.2 # Tail the logs to show Rancher $ sudo docker logs -f containerid ``` -------------------------------- ### Set Environment Variables for Rancher Compose CLI Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.1/en/quick-start-guide/index.md Exports environment variables needed for Rancher Compose to connect to Rancher server, including URL and access key. Requires API keys generated from Rancher UI. Provides authentication setup for CLI; limitation is that secret key export is not included in the example. ```bash # Set the url that Rancher is on $ export RANCHER_URL=http://server_ip:8080/ # Set the access key, i.e. username $ export RANCHER_ACCESS_KEY= ``` -------------------------------- ### Configure Rancher CLI Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/quick-start-guide/index.md Steps to configure the Rancher CLI by providing the Rancher URL, Access Key, and Secret Key. These credentials are obtained from account API keys created in the Rancher UI. ```bash # Configure Rancher CLI $ rancher config # Set the Rancher URL URL []: http://:8080/ # Set the access key, i.e. username Access Key []: # Set the secret key, i.e. password Secret Key []: ``` -------------------------------- ### SSH into RancherOS Instance Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/quick-start-guide/index.md Connect to the running RancherOS instance using the docker-machine ssh command. Replace with the actual name of your machine. ```bash $ docker-machine ssh ``` -------------------------------- ### Deploy Rancher Server with Docker Source: https://context7.com/rancher/rancher.github.io/llms.txt Quick start installation for Rancher server deployment. Starts server on port 8080 with persistent restart policy. Includes instructions for adding hosts through Rancher agent containers. Requires Docker to be installed on target systems. ```bash # Start Rancher server on port 8080 sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable # Tail logs to verify startup sudo docker logs -f # Wait for: ".... Startup Succeeded, Listening on port..." # Access UI at http://:8080 (use real IP, not localhost) # Add host using custom command from UI (with public IP specified) sudo docker run -e CATTLE_HOST_LABELS='...' -d --privileged \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /var/lib/rancher:/var/lib/rancher \ rancher/agent:v1.2.11 http://:8080/v1/scripts/ ``` -------------------------------- ### Docker Compose Configuration for WordPress Application Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.0/en/quick-start-guide/index.md Defines a multi-container WordPress application using Docker Compose. It includes a WordPress service linked to a MySQL database and a load balancer service to distribute traffic. ```yaml mywordpress: tty: true image: wordpress links: - database:mysql stdin_open: true wordpresslb: ports: - 80:80 tty: true image: rancher/load-balancer-service links: - mywordpress:mywordpress stdin_open: true database: environment: MYSQL_ROOT_PASSWORD: pass1 tty: true image: mysql stdin_open: true ``` -------------------------------- ### Deploy Application with Rancher CLI Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/quick-start-guide/index.md Command to deploy an application stack to Rancher using the configured CLI. This command assumes docker-compose.yml and rancher-compose.yml files are present in the current directory. ```bash $ rancher up -d -s NewLetsChatApp ``` -------------------------------- ### Set Rancher Compose Environment Variables Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.0/en/quick-start-guide/index.md Configures the necessary environment variables for the `rancher-compose` CLI tool to connect to a Rancher instance. This includes the Rancher URL and API key credentials. ```bash # Set the url that Rancher is on $ export RANCHER_URL=http://server_ip:8080/ ``` -------------------------------- ### Rancher Compose Configuration for WordPress Application Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.0/en/quick-start-guide/index.md Defines the scaling and load balancer configuration for a multi-container WordPress application using Rancher Compose. It complements a standard docker-compose.yml file by adding Rancher-specific settings. ```yaml mywordpress: scale: 2 wordpresslb: scale: 1 load_balancer_config: haproxy_config: {} health_check: port: 42 interval: 2000 unhealthy_threshold: 3 healthy_threshold: 2 response_timeout: 2000 database: scale: 1 ``` -------------------------------- ### List System Docker Containers (RancherOS) Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/quick-start-guide/index.md Displays the containers managed by the System Docker daemon in RancherOS. This command requires root privileges and should be prefixed with 'sudo'. It shows system services essential for RancherOS operation. ```bash $ sudo system-docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6f56057cf5ba rancher/os-base:v0.5.0 "/usr/sbin/entry.sh /" 16 seconds ago Up 15 seconds docker bd5376830237 rancher/os-console:v0.5.0 "/usr/sbin/entry.sh /" 16 seconds ago Up 15 seconds console ede8ce39fff5 rancher/os-base:v0.5.0 "/usr/sbin/entry.sh n" 16 seconds ago Up 15 seconds network 9e5d18bca391 rancher/os-base:v0.5.0 "/usr/sbin/entry.sh n" 17 seconds ago Up 16 seconds ntp 393b9fb7e30a rancher/os-base:v0.5.0 "/usr/sbin/entry.sh n" 18 seconds ago Up 16 seconds udev dc2cafca3c69 rancher/os-syslog:v0.5.0 "/usr/sbin/entry.sh /" 18 seconds ago Up 17 seconds syslog 439d5535fbfa rancher/os-base:v0.5.0 "/usr/sbin/entry.sh /" 18 seconds ago Up 17 seconds acpid ``` -------------------------------- ### Start Rancher server with bind‑mounted MySQL volume (Docker Bash) Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.3/en/installing-rancher/installing-server/index.md Launches Rancher server container with the MySQL data directory bind‑mounted to a host directory, ensuring data persistence across container restarts. Replace with the desired host path. ```Bash $ sudo docker run -d -v :/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server ``` -------------------------------- ### Dockerfile for Linux-dash System Service Container Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.0/en/quick-start-guide/index.md This Dockerfile sets up Linux-dash, a lightweight web dashboard for server monitoring, using the hwestphal/nodebox image. It installs dependencies, downloads and builds the Linux-dash application, and configures the entrypoint to start the server. The default port is 80. ```dockerfile FROM hwestphal/nodebox MAINTAINER hussein.galal.ahmed.11@gmail.com RUN opkg-install unzip RUN curl -k -L -o master.zip https://github.com/afaqurk/linux-dash/archive/master.zip RUN unzip master.zip WORKDIR linux-dash-master RUN npm install ENTRYPOINT ["node","server"] ``` -------------------------------- ### Rancher Compose Command Line Examples Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.4/en/cattle/rancher-compose/commands/index.md Practical command-line examples for deploying services with Rancher Compose. Shows stack creation, service scaling, and specific service deployment. Uses environment variables for Rancher API credentials and supports automatic stack creation if stack doesn't exist. ```bash # Creating and starting services without environment variables and selecting a stack # If the stack does not exist in Rancher, it will be created in Rancher $ rancher-compose --url URL_of_Rancher --access-key --secret-key -p stack1 up ``` ```bash # Creating and starting services with environment variables already set $ rancher-compose -p stack1 up ``` ```bash # To change the scale of an existing service $ rancher-compose -p stack1 scale web=3 ``` ```bash # To launch a specific service in the docker-compose.yml $ rancher-compose -p stack1 up web ``` -------------------------------- ### Get ROS Version Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/quick-start-guide/index.md Displays the version of the 'ros' command-line tool, used for controlling and configuring RancherOS. ```bash $ ros -v ros version 0.0.1 ``` -------------------------------- ### Rancher Load Balancer Example (L7) (docker-compose.yml) Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/cattle/adding-load-balancers/index.md This docker-compose.yml file provides a basic setup for a Layer 7 (L7) load balancer in Rancher. It defines a 'web' service and a 'lb' service using the rancher/lb-service-haproxy image, exposing ports 80 and 82. This configuration is a starting point for more complex L7 routing rules. ```yaml version: '2' services: web: image: nginx lb: image: rancher/lb-service-haproxy ports: - 80 - 82 ``` -------------------------------- ### Install RancherOS to disk using ros install (bash) Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.0/en/running-rancheros/server/install-to-disk/index.md Executes the ros install command to write RancherOS onto a specified block device, optionally selecting a custom installer image. Includes examples for normal installation, listing available images,ing into the new system, and performing an when internet access is unavailable. ```bash $ sudo ros install -c cloud-config.yml -d /dev/sda INFO[0000] No install type specified...defaulting to generic Installing from rancher/os:v0.5.0 Continue [y/N]: ``` ```bash Unable to find image 'rancher/os:v0.5.0' locally v0.5.0: Pulling from rancher/os ... ... Status: Downloaded newer image for rancher:v0.5.0 + DEVICE=/dev/sda ... + umount /mnt/new_img Continue with reboot [y/N]: ``` ```bash $ sudo ros os list rancher/os:v0.4.0 remote rancher/os:v0.4.1 remote rancher/os:v0.4.2 remote rancher/os:v0.4.3 remote rancher/os:v0.4.4 remote rancher/os:v0.4.5 remote rancher/os:v0.5.0 remote ``` ```bash $ ssh -i /path/to/private/key rancher@ ``` ```bash $ sudo ros install -c cloud-config.yml -d /dev/sda -i INFO[0000] No install type specified...defaulting to generic Installing from Continue [y/N]: ``` -------------------------------- ### RancherOS Quick Start Source: https://context7.com/rancher/rancher.github.io/llms.txt Instructions for deploying RancherOS using Docker Machine for local development, including creating an instance, SSHing into it, and viewing system Docker containers. ```APIDOC ## RancherOS Quick Start ### Description Deploy and access RancherOS for local development and testing. ### Launching RancherOS * **Create RancherOS instance with Docker Machine:** ```bash docker-machine create -d virtualbox \ --virtualbox-boot2docker-url https://releases.rancher.com/os/latest/rancheros.iso \ rancher-dev ``` * **SSH into the RancherOS instance:** ```bash docker-machine ssh rancher-dev ``` * **View System Docker containers (requires root):** ```bash sudo system-docker ps ``` *Example Output* ``` CONTAINER ID IMAGE COMMAND NAMES 6f56057cf5ba rancher/os-base:v0.5.0 "/usr/sbin/entry..." docker bd5376830237 rancher/os-console:v0.5.0 "/usr/sbin/entry..." console ede8ce39fff5 rancher/os-base:v0.5.0 "/usr/sbin/entry..." network ``` ``` -------------------------------- ### Launch and Access RancherOS on AWS EC2 Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/running-rancheros/cloud/aws/index.md Commands to launch RancherOS instances on AWS EC2 using the CLI and establish SSH connections. Requires AWS CLI installation, configured access keys, valid SSH key pair, and security group configuration. These commands facilitate instance creation and remote access to RancherOS systems. ```shell $ aws ec2 run-instances --image-id ami-ID# --count 1 --instance-type t2.micro --key-name MySSHKeyName --security-groups sg-name ``` ```shell $ ssh -i /Directory/of/MySSHKeyName.pem rancher@ ``` ```shell $ ssh -v -i /Directory/of/MySSHKeyName.pem rancher@ ``` -------------------------------- ### Set Kernel Parameters During RancherOS Installation Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.x/en/configuration/adding-kernel-parameters/index.md Use the --append parameter during RancherOS installation to disk to set additional kernel parameters. Example enables autologin on tty1. ```bash sudo ros install -d /dev/sda --append "rancheros.autologin=tty1" ``` -------------------------------- ### POST /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/api/v2-beta/api-resources/container/index.md Starts a container instance in the specified project. This action initiates the container startup process and returns an updated instance resource. ```APIDOC ## POST /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start ### Description Starts a container instance in the specified project. This action initiates the container startup process and returns an updated instance resource. ### Method POST ### Endpoint /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start ### Parameters #### Path Parameters - **PROJECT_ID** (string) - Required - The ID of the project containing the container - **ID** (string) - Required - The ID of the container to start #### Query Parameters This action has no query parameters. #### Request Body This action has no inputs. ### Request Example ```json { "example": "No request body required" } ### Response #### Success Response (200) - **instance** (object) - An updated copy of the instance resource #### Response Example ```json { "example": "updated instance resource" } ``` ``` -------------------------------- ### Enable and Build ZFS Service in RancherOS Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.0/en/storage/using-zfs/index.md These commands enable and start the ZFS service in RancherOS. The service installs ZFS on Linux, builds a zfs-tools image, and allows you to verify the installation by checking loaded kernel modules. ```bash sudo ros service enable zfs sudo ros service up zfs # you can follow the progress of the build by running the following command in another ssh session: sudo ros service logs --follow zfs # wait until the build is finished. lsmod | grep zfs ``` -------------------------------- ### POST /v1/projects/${PROJECT_ID}/containers/${ID}?action=start Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.5/en/api/v1/api-resources/container/index.md Starts a container. This action does not require any input and returns an updated instance resource. ```APIDOC ## POST /v1/projects/${PROJECT_ID}/containers/${ID}?action=start ### Description Starts a container. This action does not require any input and returns an updated instance resource. ### Method POST ### Endpoint /v1/projects/${PROJECT_ID}/containers/${ID}?action=start ### Parameters #### Path Parameters - **PROJECT_ID** (string) - Required - The ID of the project. - **ID** (string) - Required - The ID of the container. ### Request Example ```json { "example": "No request body needed" } ``` ### Response #### Success Response (200) - **instance** (object) - An updated copy of the instance resource. #### Response Example ```json { "example": "response body for instance" } ``` ``` -------------------------------- ### Get Rancher Server Container Help Options Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/installing-rancher/installing-server/index.md This command displays all available help options for the Rancher server Docker container. It's useful for understanding the various flags and configurations that can be passed when running the container, such as port mappings, volume mounts, and environment variables. ```bash docker run rancher/server --help ``` -------------------------------- ### Upgrade Rancher HA Setup in Bash Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.5/en/upgrading/index.md These commands stop all original Rancher server containers across HA nodes, start a new container with updated image tag and DB connection details, and optionally remove old containers for legacy HA setups. Requires Docker and external database. Inputs are container names, new image tag, DB credentials, and node IP. Outputs a new HA Rancher server setup. Limitations: Full downtime during upgrade; backup DB first; must start new container on one node first before others. ```bash # On all nodes, stop all Rancher server containers $ docker stop # Start new container with new version tag $ docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server: --db-host myhost.example.com --db-port 3306 --db-user username --db-pass password --db-name cattle --advertise-address # For older HA, remove all Rancher containers: $ sudo docker rm -f $(sudo docker ps -a | grep rancher | awk {'print $1'}) ``` -------------------------------- ### Docker Compose Load Balancer Setup Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.1/en/cattle/adding-load-balancers/index.md Example docker-compose.yml configuration for launching a Rancher load balancer service linked to an application container. ```yaml letschatlb: ports: - 80:8080 image: rancher/load-balancer-service links: - letschat:letschat ``` -------------------------------- ### Stop and Start Rancher HA Containers (Bash) Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/upgrading/index.md Commands to stop all running Rancher server containers on each node in an HA setup and then start a new container with a specified new version tag. This process requires careful monitoring of container startup and database resource usage. ```bash # On all nodes, stop all Rancher server containers $ docker stop # Start a new container with the new version tag $ docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server: --db-host myhost.example.com --db-port 3306 --db-user username --db-pass password --db-name cattle --advertise-address ``` -------------------------------- ### Running Rancher Server with Increased Memory Allocation via Docker Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.0/en/faqs/server/index.md This command starts a Rancher server container with additional Java heap memory to resolve out-of-memory issues caused by stuck processes consuming excessive resources. It requires Docker to be installed and running. Inputs include the Docker image version and port mappings; outputs a responsive server instance typically with 4GB allocation. Limitations: Requires server restart and may need database upgrade adjustments based on MySQL setup. ```bash $ docker run -d -p 8080:8080 --restart=always -e JAVA_OPTS="-Xmx4096m" rancher/server:v1.0.2 ``` -------------------------------- ### Deploy LetsChat Application using docker-compose on Rancher Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.6/en/quick-start-guide/index.md This docker-compose.yml defines the load balancer, web, and database services required for the LetsChat application. It specifies images, ports, labels, and service links, enabling Rancher CLI to replicate the UI configuration. The file assumes Rancher’s built-in HAProxy load balancer image and requires the sdelements/lets-chat and mongo images. ```YAML version: '2'\nservices:\n letschatapplb:\n #If you only have 1 host and also created the host in the UI,\n # you may have to change the port exposed on the host.\n ports:\n - 80:80/tcp\n labels:\n io.rancher.container.create_agent: 'true'\n io.rancher.container.agent.role: environmentAdmin\n image: rancher/lb-service-haproxy:v0.4.2\n web:\ labels:\n io.rancher.container.pull_image: always\n tty: true\n image: sdelements/lets-chat\n links:\n - database:mongo\n stdin_open: true\n database:\n labels:\n io.rancher.container.pull_image: alwaysn tty: true\n image: mongo\n stdin_open: true ``` -------------------------------- ### Load Compiled Kernel Module with Modprobe Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.1/en/configuration/loading-kernel-modules/index.md Command to load a compiled kernel module using modprobe after it has been built and installed. This example shows loading the intel-ishtp module that was built in the previous step. The module must be properly installed in the correct kernel module directory for modprobe to find it. ```bash modprobe intel-ishtp ``` -------------------------------- ### POST /v1/projects/${PROJECT_ID}/containers/${ID}?action=start Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.3/en/api/v1/api-resources/container/index.md Starts a specified container. ```APIDOC ## POST /v1/projects/${PROJECT_ID}/containers/${ID}?action=start ### Description Starts a specified container. ### Method POST ### Endpoint `/v1/projects/${PROJECT_ID}/containers/${ID}?action=start` ### Parameters #### Path Parameters - **PROJECT_ID** (string) - Required - The ID of the project. - **ID** (string) - Required - The ID of the container. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **instance** (object) - An updated copy of the instance resource. #### Response Example ```json { "example": "An updated copy of the instance resource" } ``` ``` -------------------------------- ### Deploy LetsChat Application using Rancher CLI (docker-compose.yml) Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/quick-start-guide/index.md This YAML file defines a multi-container LetsChat application for deployment via Rancher CLI. It includes services for a load balancer (letschatapplb), the web application (web), and a database (database). The 'web' service is linked to the 'database' service and configured to scale. ```yaml version: '2' services: letschatapplb: #If you only have 1 host and also created the host in the UI, # you may have to change the port exposed on the host. ports: - 80:80/tcp labels: io.rancher.container.create_agent: 'true' io.rancher.container.agent.role: environmentAdmin image: rancher/lb-service-haproxy:v0.4.2 web: labels: io.rancher.container.pull_image: always tty: true image: sdelements/lets-chat links: - database:mongo stdin_open: true database: labels: io.rancher.container.pull_image: always tty: true image: mongo stdin_open: true ``` -------------------------------- ### POST /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start Source: https://github.com/rancher/rancher.github.io/blob/master/rancher/v1.2/en/api/v2-beta/api-resources/container/index.md Starts a specified container. ```APIDOC ## POST /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start ### Description Starts a specified container. ### Method POST ### Endpoint /v2-beta/projects/${PROJECT_ID}/containers/${ID}?action=start ### Parameters #### Path Parameters - **PROJECT_ID** (string) - Required - The ID of the project. - **ID** (string) - Required - The ID of the container. #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **instance** (object) - An updated copy of the instance resource. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### List Running Docker Containers Source: https://github.com/rancher/rancher.github.io/blob/master/os/v1.2/en/quick-start-guide/index.md Shows the currently running containers managed by the standard Docker daemon. This command is used after deploying a container to verify its status. ```bash $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e99c2c4b8b30 nginx "nginx -g 'daemon off" 12 seconds ago Up 11 seconds 80/tcp, 443/tcp drunk_ptolemy ```