hi everyone! Im exploring the CI part of Dagger, and trying to automate the process to get the docker images ready. Im trying to build the images pointing to the description in a docker-compose, and im having docker connectivity issues:
│ ∅ .withExec(args: ["docker-compose", "-f", "/src/orch-docker-compose.yaml", "build", "globalmgmt"]): Container! 8.5s
│ ┃ Building globalmgmt
│ ┃ Couldn't connect to Docker daemon at http+docker://localhost - is it running?
│ ┃
│ ┃ If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
This is the code at this moment:
@function
async def build_and_up_service(
self,
compose_file_path: str,
service_name: str,
orch_dir: Annotated[dagger.Directory, Doc("Source directory")]
) -> str:
basecontainer = (
dag.container()
.from("docker/compose:latest")
.with_directory("/src", orch_dir)
.with_workdir("/src")
#.with_unix_socket(host_docker_socket, "/var/run/docker.sock") # Use the Socket object here
# Set DOCKER_HOST environment variable just in case, though with socket mount it's often implicit
#.with_env_variable("DOCKER_HOST", "unix:///var/run/docker.sock")
)
and this is how im running it:
dagger call build-and-up-service --compose-file-path="/src/orch-docker-compose.yaml" --service-name=globalmgmt --orch_dir="../../../../orchestrators"
thanks in advance for the help!