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

Network mode in compose file build section not passed to Podman build command #1027

Open
epartridge16 opened this issue Sep 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@epartridge16
Copy link

Describe the bug

When specifying the network mode in the build section of a docker-compose file, it does not get passed to the podman build command. The only way to set the network mode during the build process is too pass it through the podman-args

Steps to reproduce the issue:
docker-compose.yml:

version: '3'
services:
  web:
    image: gcr.io/google-samples/hello-app-build:1.0
    build:
      context: .
      network: host
      dockerfile: Dockerfile
    ports:
        - "${HOST_PORT:-8080}:8080"

Dockerfile:

FROM gcr.io/google-samples/hello-app:1.0

Describe the results you received:
Using podman compose --verbose build I get the following output

INFO:podman_compose:podman build -f /home/labuser/development/test/Dockerfile -t gcr.io/google-samples/hello-app-build:1.0 /home/labuser/development/test

Describe the results you expected:
Using podman-build-args as such podman compose --verbose --podman-build-args="--network=host" I get the following which allows the RUN commmands to run on the host network

INFO:podman_compose:podman build --network=host -f /home/labuser/development/test/Dockerfile -t gcr.io/google-samples/hello-app-build:1.0 /home/labuser/development/test

Output of rpm -q buildah or apt list buildah:

buildah-1.33.8-1.module+el8.10.0+21995+81e8507c.x86_64

Output of buildah version:

Version:         1.33.8
Go Version:      go1.21.7 (Red Hat 1.21.7-2.module+el8.10.0+21638+b01be198)
Image Spec:      1.1.0-rc.5
Runtime Spec:    1.1.0
CNI Spec:        1.0.0
libcni Version:  v1.1.2
image Version:   5.29.3
Git Commit:
Built:           Tue Jun 18 05:33:28 2024
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64

Output of podman version if reporting a podman build issue:

Client:       Podman Engine
Version:      4.9.4-rhel
API Version:  4.9.4-rhel
Go Version:   go1.21.7 (Red Hat 1.21.7-2.module+el8.10.0+21638+b01be198)
Built:        Tue Jun 18 05:34:14 2024
OS/Arch:      linux/amd64

Output of cat /etc/*release:

NAME="Red Hat Enterprise Linux"
VERSION="8.10 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.10 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://issues.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.10
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.10"
Red Hat Enterprise Linux release 8.10 (Ootpa)
Red Hat Enterprise Linux release 8.10 (Ootpa)
@epartridge16 epartridge16 added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant