Build and start the Docker container using the Docker compose command.
(self)
| 94 | return result.returncode == 0 |
| 95 | |
| 96 | def start(self): |
| 97 | """Build and start the Docker container using the Docker compose command.""" |
| 98 | print( |
| 99 | f"[INFO] Building the docker image and starting the container '{self.container_name}' in the" |
| 100 | " background...\n" |
| 101 | ) |
| 102 | |
| 103 | # build the image for the base profile |
| 104 | subprocess.run( |
| 105 | [ |
| 106 | "docker", |
| 107 | "compose", |
| 108 | "--file", |
| 109 | "docker-compose.yaml", |
| 110 | "--env-file", |
| 111 | ".env.base", |
| 112 | "build", |
| 113 | "isaac-lab-base", |
| 114 | ], |
| 115 | check=False, |
| 116 | cwd=self.context_dir, |
| 117 | env=self.environ, |
| 118 | ) |
| 119 | |
| 120 | # build the image for the profile |
| 121 | subprocess.run( |
| 122 | ["docker", "compose"] |
| 123 | + self.add_yamls |
| 124 | + self.add_profiles |
| 125 | + self.add_env_files |
| 126 | + ["up", "--detach", "--build", "--remove-orphans"], |
| 127 | check=False, |
| 128 | cwd=self.context_dir, |
| 129 | env=self.environ, |
| 130 | ) |
| 131 | |
| 132 | def enter(self): |
| 133 | """Enter the running container by executing a bash shell. |
no test coverage detected