podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

container_name doens't work with build command - unable to find container example.com:example.com is a pod, not a container

Open ThomasKoscheck opened this issue 4 years ago • 3 comments

Hey,

when I use the build argument together with container_name I get the following error:

podman pod create --name=example.com --share net -p 127.0.0.1:4000:3003
26c1220e39bfffd0d1f5eff52430836d27d5b2e27c84439dee178a1253d03c9f
0
podman create --name=example.com --pod=example.com -l io.podman.compose.config-hash=123 -l io.podman.compose.project=example.com -l io.podman.compose.version=0.0.1 -l com.docker.compose.container-number=1 -l com.docker.compose.service=example.com --mount type=bind,source=/var/www/example/example.com/.,destination=/usr/app --mount type=bind,source=/var/www/example/example.com/.,destination=/usr/app/node_modules --add-host example.com:127.0.0.1 --add-host example.com:127.0.0.1 example.com_example.com npm run dev
Error: name example.com is in use: container already exists
125
podman start -a example.com
Error: unable to find container example.com:example.com is a pod, not a container: no such container

When I remove the container_name argument, everything works as expected.

My docker-compose:

version: "3"

services:
  example.com:
    restart: always
    build: .
    command: npm run dev
    container_name: example.com
    volumes:
      - .:/usr/app
    ports:
      - 127.0.0.1:4000:3003

My Dockerfile

FROM node:alpine

RUN apk update \
        && apk add \
        git 

WORKDIR /usr/app

COPY package.json .
RUN npm install --quiet
COPY . .

The command I run to reproduce the error:

sudo podman-compose up

Thank you very much

Kind regards Thomas

ThomasKoscheck avatar Apr 13 '20 10:04 ThomasKoscheck

Please help! I can't install podman-compose using dnf on CentOS8.2 with Podman 2.1.1 . To which repo it is submitted? [root@MSI bin]# dnf install podman-compose Last metadata expiration check: 0:29:04 ago on Fri 23 Oct 2020 01:14:51 PM IDT. No match for argument: podman-compose Error: Unable to find a match: podman-compose

PavelSosin-320 avatar Oct 23 '20 10:10 PavelSosin-320

Install it like this

pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz

muayyad-alsadi avatar Oct 23 '20 13:10 muayyad-alsadi

I had the same issue with minio, with service, container_name and image name as "minio". I changed container_name to "(app)_minio", that solved the problem.

services:
  minio:
    image: minio/minio:latest
    container_name: myapp_minio

pajoma avatar Sep 30 '21 12:09 pajoma