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

Dockerfile COPY command failing. Podman Build Context incorrectly translating path on Windows. #13119

Closed
Bitshu opened this issue Feb 2, 2022 · 5 comments · Fixed by #13120
Closed
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. remote Problem is in podman-remote windows issue/bug on Windows

Comments

@Bitshu
Copy link

Bitshu commented Feb 2, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
Dockerfile COPY command fails on Windows whilst succeeding in Linux.

This is my first ever issue created. I hope the information provided was useful. Please let me know if you need more information.
I won't be able to share the projects as they are company property.

Dockerfile Content (Partial)
I had to mask some information. I hope this won't be an issue...

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build

WORKDIR /src

COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]

...

Describe the results you received:
This command is executed with podman running on Windows (Client).

> podman build -t test -f Dockerfile ../..
> Error: stat /var/tmp/libpod_builder190431393/build/src\FmcExample\Dockerfile: no such file or directory

Describe the results you expected:
This command is executed with podman running on Linux (Fedora Remix, WSL2).

> podman build -t test -f Dockerfile ..\..

[2/4] STEP 2/15: WORKDIR /src
--> 3fdc16f6918
[2/4] STEP 3/15: COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
--> 61f0284c9d1
[2/4] STEP 4/15: COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
--> 493b1d564be
[2/4] STEP 5/15: COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
--> 2b0f297e82d
[2/4] STEP 6/15: COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]
--> a937c62eb7a
[2/4] STEP 7/15: COPY ["src/<folder>/<filename>.<extension>", "src/<folder>/"]

...

Output of podman version:

Client:
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.16.8
Git Commit:   f6526ada1025c2e3f88745ba83b8b461ca659933
Built:        Wed Dec  8 22:14:28 2021
OS/Arch:      windows/amd64

Server:
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.16.8
Built:        Wed Dec  8 22:45:07 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.30-2.fc35.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.30, commit: '
  cpus: 16
  distribution:
    distribution: fedoraremixforwsl
    version: "35"
  eventLogger: journald
  hostname: EN3310137-wsl
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 5.10.60.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 6076252160
  memTotal: 13168848896
  ociRuntime:
    name: crun
    package: crun-1.4.1-1.fc35.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.1
      commit: 802613580a3f25a88105ce4b78126202fef51dfb
      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: false
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc35.x86_64
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 7h 23m 42.62s (Approximately 0.29 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/<username>/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.7.1-2.fc35.x86_64
      Version: |-
        fusermount3 version: 3.10.5
        fuse-overlayfs: version 1.7.1
        FUSE library version 3.10.5
        using FUSE kernel interface version 7.31
  graphRoot: /home/<username>/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 28
  runRoot: /run/user/1000/containers
  volumePath: /home/<username>/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 1638999907
  BuiltTime: Wed Dec  8 22:45:07 2021
  GitCommit: ""
  GoVersion: go1.16.8
  OsArch: linux/amd64
  Version: 3.4.4

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

Name         : podman
Epoch        : 3
Version      : 3.4.4
Release      : 1.fc35
Architecture : x86_64
Size         : 48 M
Source       : podman-3.4.4-1.fc35.src.rpm
Repository   : @System
From repo    : updates
Summary      : Manage Pods, Containers and Container Images
URL          : https://podman.io/
License      : ASL 2.0
Description  : podman (Pod Manager) is a fully featured container engine that is a simple
             : daemonless tool.  podman provides a Docker-CLI comparable command line that
             : eases the transition from other container engines and allows the management of
             : pods, containers and images.  Simply put: alias docker=podman.
             : Most podman commands can be run as a regular user, without requiring
             : additional privileges.
             :
             : podman uses Buildah(1) internally to create container images.
             : Both tools share image (not container) storage, hence each can use or
             : manipulate images (but not containers) created by the other.
             :
             : Manage Pods, Containers and Container Images
             : podman Simple management tool for pods, containers and images
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 2, 2022
@github-actions github-actions bot added remote Problem is in podman-remote windows issue/bug on Windows labels Feb 2, 2022
@nalind
Copy link
Member

nalind commented Feb 2, 2022

A guess: it looks like I missed slashifying the path of the Dockerfile as supplied in the API's dockerfile parameter, so when it's not in the top level of the context directory, the relative path that gets passed still uses the client OS's path separator.

@nalind
Copy link
Member

nalind commented Feb 2, 2022

@Bitshu thanks for spotting this!

@Bitshu
Copy link
Author

Bitshu commented Feb 2, 2022

@nalind No problemo! Thank you for coming up with a quick fix!

@Bitshu
Copy link
Author

Bitshu commented Feb 3, 2022

@nalind As soon as the PR gets approved... will there be a way for me to test this on Podman for Windows?

@nalind
Copy link
Member

nalind commented Feb 3, 2022

@nalind As soon as the PR gets approved... will there be a way for me to test this on Podman for Windows?

If you're able to check out the code from source on a Linux box, make podman-remote-windows should produce a binary that can be copied to a Windows machine, which is what I used to spot-check it.

@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. remote Problem is in podman-remote windows issue/bug on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants