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

broken build because invalid mount type "cache" in RUN #12062

Closed
sn3d opened this issue Oct 22, 2021 · 9 comments
Closed

broken build because invalid mount type "cache" in RUN #12062

sn3d opened this issue Oct 22, 2021 · 9 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@sn3d
Copy link

sn3d commented Oct 22, 2021

/kind bug

Description

Podman build failed when Dockerfile contains RUN --mount=cache

Steps to reproduce the issue:

  1. Create simple Dockerfile with RUN --mount=cache
# syntax = docker/dockerfile:1.3
FROM docker.io/golang:1.16-alpine

COPY go.mod ./
COPY go.sum ./
RUN go mod download

COPY *.go ./

RUN --mount=type=cache,target=/root/.cache/go-build go build main.go
  1. run the podman build .

Describe the results you received:

STEP 5/5: RUN --mount=type=cache,target=/root/.cache/go-build go build main.go
Error: error building at STEP "RUN --mount=type=cache,target=/root/.cache/go-build go build main.go": error resolving mountpoints for container "914f40500cb2493d32ad0b191976fc87451d7814a421ffecc3ea2485285664a8": invalid mount type "cache"

Describe the results you expected:

Maybe podman build should continue without cache. Rather no-cache than broken build.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:
Version:      3.4.1
API Version:  3.4.1
Go Version:   go1.17.2
Built:        Tue Oct 19 23:14:42 2021
OS/Arch:      darwin/amd64

Server:
Version:      3.4.0
API Version:  3.4.0
Go Version:   go1.16.8
Built:        Thu Sep 30 21:40:21 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.30-2.fc34.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.30, commit: '
  cpus: 1
  distribution:
    distribution: fedora
    variant: coreos
    version: "34"
  eventLogger: journald
  hostname: localhost
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.14.11-200.fc34.x86_64
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 940654592
  memTotal: 2061860864
  ociRuntime:
    name: crun
    package: crun-1.2-1.fc34.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.2
      commit: 4f6c8e0583c679bfee6a899c05ac6b916022561b
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  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: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc34.x86_64
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.4.0
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 0
  swapTotal: 0
  uptime: 1m 58.26s
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 4
  runRoot: /run/user/1000/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.0
  Built: 1633030821
  BuiltTime: Thu Sep 30 19:40:21 2021
  GitCommit: ""
  GoVersion: go1.16.8
  OsArch: linux/amd64
  Version: 3.4.0

Package info (e.g. output of rpm -q podman or apt list podman):

podman: stable 3.4.1 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/usr/local/Cellar/podman/3.4.1 (170 files, 39.5MB) *
  Poured from bottle on 2021-10-22 at 10:27:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Analytics
install: 14,507 (30 days), 28,358 (90 days), 55,711 (365 days)
install-on-request: 14,507 (30 days), 28,358 (90 days), 55,625 (365 days)
build-error: 0 (30 days)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 22, 2021
@sn3d sn3d changed the title broken build because unsupported mount cache for RUN broken build because invalid mount type "cache" in RUN Oct 22, 2021
@flouthoc
Copy link
Collaborator

@sn3d This was recently merged in buildah. You will find this in newer versions of podman as soon as buildah is vendored in.
I'd recommend using buildah from main to build images for now.

containers/buildah#3574

Closing this one. Please re-open if something is not resolved.

@sn3d
Copy link
Author

sn3d commented Oct 25, 2021

@flouthoc Thanks for clarification. Make sense. This brings me to another question but I'll ask in Discussions. Thanks a lot.

@flouthoc
Copy link
Collaborator

@sn3d Sure or you can continue discussion on this issue or open a new issue on buildah or a Discussions. Whatever you feel is the best place.

@KUGA2
Copy link

KUGA2 commented Dec 2, 2021

Hi, is there a new version out supporting this?
I just installed it on ubuntu 20.04 (with this instructions) and i got podman version 3.4.2.

@rhatdan
Copy link
Member

rhatdan commented Dec 2, 2021

3.4.2 is the latest version.

@jan-xyz
Copy link

jan-xyz commented Feb 8, 2022

The buildah dependency is only updated for 4.0.0 any plan to also bump it for the 3.x branch?

@flouthoc
Copy link
Collaborator

flouthoc commented Feb 8, 2022

@jan-xyz I don't think this will be propagated back to 3.x branch. @rhatdan Can tell this better though.

@mheon
Copy link
Member

mheon commented Feb 8, 2022

We do not plan any further releases from the v3.x branches. Podman v4.0 should release next Tuesday.

@jan-xyz
Copy link

jan-xyz commented Feb 8, 2022

Alright thanks for the quick reply ❤️❤️

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

6 participants