Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with Containerfile instead of Dockerfile #167

Closed
dduenker opened this issue May 5, 2020 · 8 comments
Closed

Build with Containerfile instead of Dockerfile #167

dduenker opened this issue May 5, 2020 · 8 comments

Comments

@dduenker
Copy link

dduenker commented May 5, 2020

I just tried to create a stack which uses a file named Containerfile instead of Dockerfile, which apparently does not work.
Is it possible to support the tool agnostic Containerfile as filename?

On a related note: why not use container-compose.yaml as well? :)

@smarnv
Copy link
Contributor

smarnv commented Oct 13, 2020

I would also appreciate support for Containerfile. Using container-compose.y(a)ml is already possible (see #46).

@mks-h
Copy link

mks-h commented Nov 11, 2021

It's strange it isn't a thing yet. I say it has to be of a higher priority since Podman itself uses "Containerfile" just fine

@muayyad-alsadi
Copy link
Collaborator

please test

@mks-h
Copy link

mks-h commented Nov 11, 2021

❯ podman-compose up
Error: error inspecting object: bib_db: image not known
Traceback (most recent call last):
  File "/home/mks/.local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 1093, in main
    podman_compose.run()
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 625, in run
    cmd(self, args)
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 884, in compose_up
    compose.commands['build'](compose, build_args)
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 850, in compose_build
    build_one(compose, args, cnt)
  File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 834, in build_one
    raise OSError("Dockerfile not found in "+ctx)
OSError: Dockerfile not found in db/.

Writing build: db/Containerfile in the docker-compose.yml didn't help.
Here is the content of db/Containerfile:

FROM mongo:latest
COPY init.js /docker-entrypoint-initdb.d/init.js

It worked perfectly fine with docker-compose wired to podman

docker-compose.yml:

version: "3.9"

services:
  db:
    build: db/.
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
    volumes:
      - ${MONGO_DB_DIR}:/data/db
    networks:
      - backend

  api:
    build: api/.
    restart: always
    networks:
      - backend

networks:
  backend:
    driver: bridge

@muayyad-alsadi
Copy link
Collaborator

File "/home/mks/.local/lib/python3.10/site-packages/podman_compose.py", line 834, in build_one
    raise OSError("Dockerfile not found in "+ctx)
OSError: Dockerfile not found in db/.

this does not seem to be my code, the raise statement in my code is around line 1343

@mks-h
Copy link

mks-h commented Nov 11, 2021

Oh, turns out this is because pip features an old release. See #338

@muayyad-alsadi
Copy link
Collaborator

muayyad-alsadi commented Nov 11, 2021 via email

@mks-h
Copy link

mks-h commented Nov 13, 2021

Hi, sorry it took so long. The devel version works just fine with both Containerfile and container-compose.yml. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants