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

Problem running docker-compose with Podman on Windows 11 WSL-2 #15229

Closed
mwoodpatrick opened this issue Aug 7, 2022 · 6 comments
Closed

Problem running docker-compose with Podman on Windows 11 WSL-2 #15229

mwoodpatrick opened this issue Aug 7, 2022 · 6 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

@mwoodpatrick
Copy link

/kind bug

Description

I'm trying to find the best way to use docker-compose with Podman. Any pointers would be appreciated to best current practices. Is it still required to run podman rooted?

I'm following the steps in the article Using Podman and Docker Compose. The first example running with Gitea worked without issues however the second example used Traefik hit the error below

Steps to reproduce the issue:

  1. Setup Podman as described in above article

  2. cd ../traefik-golang/

  3. sudo docker-compose up

Describe the results you received:

		Creating network "traefik-golang_default" with the default driver
		Building backend
		Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
		[1/3] STEP 1/4: FROM golang:1.18 AS build
		✔ docker.io/library/golang:1.18
		Trying to pull docker.io/library/golang:1.18...
		Getting image source signatures
		Copying blob d9d4b9b6e964 done
		Copying blob 6b3e8fc138ed done
		Copying blob 001c52e26ad5 done
		Copying blob 2068746827ec done
		Copying blob 9daef329d350 done
		Copying blob 1c28274a8e7c done
		Copying blob f3efab82b0e6 done
		Copying config 2d952adaec done
		Writing manifest to image destination
		Storing signatures
		[1/3] STEP 2/4: WORKDIR /compose/hello-docker
		--> 3bfba2bce9f
		[1/3] STEP 3/4: COPY main.go main.go
		--> 810e555524c
		[1/3] STEP 4/4: RUN CGO_ENABLED=0 go build -o backend main.go
		--> d04bb561248
		[2/3] STEP 1/12: FROM d04bb561248bc652fc2d9229989fb80fec7c14a0ad9465958fa339e0cf2d5467 AS dev-envs
		[2/3] STEP 2/12: RUN <<EOF
		--> c48f809ce21
		[2/3] STEP 3/12: apt-get update
		ERRO[0124] +(UNHANDLED LOGLEVEL) &imagebuilder.Step{Env:[]string{"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.18.5", "GOPATH=/go"}, Command:"apt-get", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"APT-GET ", Original:"apt-get update"}
		Error: error building at STEP "APT-GET ": Build error: Unknown instruction: "APT-GET" &imagebuilder.Step{Env:[]string{"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.18.5", "GOPATH=/go"}, Command:"apt-get", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"APT-GET ", Original:"apt-get update"}

ERROR: Service 'backend' failed to build : Build failed

Describe the results you expected:

Containers would be setup as described in article

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

Output of podman version:

WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
Client:       Podman Engine
Version:      4.2.0-dev
API Version:  4.2.0-dev
Go Version:   go1.18.4
Git Commit:   fed326d8a6f8d4f7dc490099b29d51fc1754789f
Built:        Sat Jul 30 06:57:00 2022
OS/Arch:      linux/amd64

Output of podman info:

host:
  arch: amd64
  buildahVersion: 1.27.0-dev
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.72
    systemPercent: 0.15
    userPercent: 0.13
  cpus: 8
  distribution:
    distribution: fedora
    variant: container
    version: "36"
  eventLogger: file
  hostname: MarkSpectre14
  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.15.57.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 492093440
  memTotal: 1999785984
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.5
      commit: 54ebb8ca8bf7e6ddae2eb919f5b82d1d96863dea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /mnt/wslg/runtime-dir/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: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 1056141312
  swapTotal: 1073741824
  uptime: 4h 6m 45.00s (Approximately 0.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/user/.config/containers/storage.conf
  containerStore:
    number: 8
    paused: 0
    running: 1
    stopped: 7
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/user/.local/share/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 25626636288
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 5
  runRoot: /run/user/1000/containers
  volumePath: /home/user/.local/share/containers/storage/volumes
version:
  APIVersion: 4.2.0-dev
  Built: 1659189420
  BuiltTime: Sat Jul 30 06:57:00 2022
  GitCommit: fed326d8a6f8d4f7dc490099b29d51fc1754789f
  GoVersion: go1.18.4
  Os: linux
  OsArch: linux/amd64
  Version: 4.2.0-dev

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

podman-4.1.1-3.fc36.x86_64

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

Yes

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

Running on WSL-2 on windows 11

wsl --status
Default Distribution: podman-westie-test-2
Default Version: 2
WSL version: 0.65.3.0
Kernel version: 5.15.57.1
WSLg version: 1.0.41
MSRDC version: 1.2.3213
Direct3D version: 1.601.0
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22622.450
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 7, 2022
@vrothberg
Copy link
Member

Thanks for reaching out, @mwoodpatrick !

@flouthoc @nalind PTAL

@nalind
Copy link
Member

nalind commented Aug 8, 2022

[2/3] STEP 3/12: apt-get update
ERRO[0124] +(UNHANDLED LOGLEVEL) &imagebuilder.Step{Env:[]string{"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.18.5", "GOPATH=/go"}, Command:"apt-get", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"APT-GET ", Original:"apt-get update"}
Error: error building at STEP "APT-GET ": Build error: Unknown instruction: "APT-GET" &imagebuilder.Step{Env:[]string{"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.18.5", "GOPATH=/go"}, Command:"apt-get", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"APT-GET ", Original:"apt-get update"}

Missing a RUN at the start of a line?

@darthShadow
Copy link

Looks like it may not be parsing the EOF marker on the previous line correctly:

[2/3] STEP 2/12: RUN <<EOF

https://github.com/docker/awesome-compose/blob/d7f81842a4d0c78b74e84cf61d289bd58cfe4ec7/traefik-golang/backend/Dockerfile#L11

@nalind
Copy link
Member

nalind commented Aug 11, 2022

Oof, that's right, we don't have support for heredoc syntax.

@flouthoc
Copy link
Collaborator

Should we close this as dup of containers/buildah#3474 , @mwoodpatrick you can track the original issue on buildah repo.

@mwoodpatrick
Copy link
Author

Many thanks for the information, I will track the original issue, closing

@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 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 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

5 participants