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

Podman build Error: unknown flag: --tagg #24876

Closed
pliniogsnascimento opened this issue Dec 19, 2024 · 5 comments
Closed

Podman build Error: unknown flag: --tagg #24876

pliniogsnascimento opened this issue Dec 19, 2024 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote

Comments

@pliniogsnascimento
Copy link

Issue Description

While trying to run a build command with the --tag or -t flag, I receive a Error: unknown flag: --tagg

Steps to reproduce the issue

Steps to reproduce the issue

  1. Running the command podman image buid -t <tag> . or podman buid -t <tag> .

Describe the results you received

❯ podman buid -t pliniogsnascimento/java-redis-demo:0.0.1 .
Error: unknown shorthand flag: 't' in -tva-redis-demo:0.0.1 .

❯ podman image buid -t pliniogsnascimento/java-redis-demo:0.0.1 .
Error: unknown shorthand flag: 't' in -tnto/java-redis-demo:0.0.1 .

❯ podman image buid --tag "pliniogsnascimento/java-redis-demo:0.0.1" .
Error: unknown flag: --tagg "pliniogsnascimento/java-redis-demo:0.0.1" .

❯ podman image buid . --tag pliniogsnascimento/java-redis-demo:0.0.1
Error: unknown flag: --tagtag pliniogsnascimento/java-redis-demo:0.0.1

Describe the results you expected

The start of image build process

podman info output

host:
  arch: amd64
  buildahVersion: 1.38.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-2.fc40.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 99.52
    systemPercent: 0.17
    userPercent: 0.31
  cpus: 4
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "40"
  eventLogger: journald
  freeLocks: 2027
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.11.3-200.fc40.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 1572040704
  memTotal: 2052096000
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.12.2-2.fc40.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.12.2
    package: netavark-1.12.2-1.fc40.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.12.2
  ociRuntime:
    name: crun
    package: crun-1.17-1.fc40.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.17
      commit: 000fa0d4eeed8938301f3bcf8206405315bc1017
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240906.g6b38f07-1.fc40.x86_64
    version: |
      pasta 0^20240906.g6b38f07-1.fc40.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: unix:///run/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-2.fc40.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 0
  swapTotal: 0
  uptime: 0h 37m 59.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 2
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 5479809024
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.3.1
  Built: 1732147200
  BuiltTime: Wed Nov 20 21:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.7
  Os: linux
  OsArch: linux/amd64
  Version: 5.3.1

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

macOS sequoia 15.1.1 Intel

Additional information

The Dockerfile:

FROM maven:3.9.5-amazoncorretto-23 AS build
RUN mkdir /app
WORKDIR /app

ADD . /app/
RUN mvn package -Dmaven.test.skip
ENTRYPOINT [ "java", "-javaagent:/app/opentelemetry-javaagent.jar", "-jar", "/app/target/java-redis-demo.jar" ]
@pliniogsnascimento pliniogsnascimento added the kind/bug Categorizes issue or PR as related to a bug. label Dec 19, 2024
@github-actions github-actions bot added the remote Problem is in podman-remote label Dec 19, 2024
@vrothberg
Copy link
Member

podman buid -t pliniogsnascimento/java-redis-demo:0.0.1 .

There is an "L" missing. It's podman build. The error message from the parser is confusing as it points to the flag instead of the command.

@rhatdan
Copy link
Member

rhatdan commented Dec 19, 2024

Seems like more of a bug in cobra

It must be treating buid as something other then a command when you add options, and processing the options on the higher level command.

$ podman buid -t pliniogsnascimento/java-redis-demo:0.0.1 .
Error: unknown shorthand flag: 't' in -t
See 'podman --help'
$ podman buid 
Error: unrecognized command `podman buid`

Did you mean this?
	build

Try 'podman --help' for more information

@pliniogsnascimento
Copy link
Author

Alright, that makes sense. Closing it since it was no bug.

@vrothberg
Copy link
Member

Seems like more of a bug in cobra

I was surprised about the behavior as well. @Luap99 is a Cobra expert: Do you know why Cobra is behaving like that?

@Luap99
Copy link
Member

Luap99 commented Dec 19, 2024

That is a known problem, I have looked at it before #13082 but I don't think this is something that we can fix in podman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote
Projects
None yet
Development

No branches or pull requests

4 participants