for-win icon indicating copy to clipboard operation
for-win copied to clipboard

(LCOW) Linux-only containers docker-compose getting: 'cannot download image with operating system "linux" when requesting "windows"'

Open zicodes opened this issue 8 years ago • 6 comments

Expected behavior

Docker Edge running with 'Linux containers' feature enabled should pull all images from docker-compose yml as all images are Linux based.

Actual behavior

PS C:\DockerProjects\myproject> docker-compose up -d Pulling db (tutum/mysql:latest)... latest: Pulling from tutum/mysql ERROR: cannot download image with operating system "linux" when requesting "windows"

Information

Virtualisation: Proxmox 5 VM running qemu/KVM Operating System: Windows 10 Pro N (Version 1709; OS Build 16299.125)

Docker information: Version 17.12.0-ce-rc4-win44 (14896) Channel: edge f23de3e

Machine: 0.13.0 Compose: 1.18.0

Docker's Diagnostic ID: 8B85E64E-6E12-43FB-B240-432FFBB3F7EC/2017-12-31_03-46-42

Issue looks the same as; https://github.com/docker/for-win/issues/1464

Steps to reproduce the behavior

  1. docker-compose.yml with contents of:
version: '3.0'
services:
 web:
  build: .
  links:
    - db
  volumes:
    - ./public_html:/var/www/project
  ports:
    - "8080:80"
    - "3001:3001"
    - "3000:3000"
 db:
  image: tutum/mysql
  environment:
    MYSQL_USER: root
    MYSQL_PASS: password
  volumes:
    - ./Mysql:/var/lib/mysql
    - ./MysqlHome:/root
  ports:
    - "3306:3306"
 phpmyadmin:
  image: phpmyadmin/phpmyadmin
  ports:
    - 81:80
  links:
      - db
  environment:
    PMA_HOST: db
  1. Run 'docker-compose up -d' in the source directory.

zicodes avatar Dec 31 '17 03:12 zicodes

needs $Env:DOCKER_DEFAULT_PLATFORM = 'linux'

jstacoder avatar Jan 02 '18 08:01 jstacoder

I'm getting the same message even after setting DOCKER_DEFAULT_PLATFORM

Version 17.12.0-ce-win45 (15017)
Channel: edge
6bbf198

jamiegs avatar Jan 12 '18 23:01 jamiegs

@zeecodes what happens if you pre-pull the images and specify the --platform flag?

docker pull --platform linux tutum/mysql docker pull --platform linux phpmyadmin/phpmyadmin

carlfischer1 avatar Jan 13 '18 01:01 carlfischer1

Just missing a global environment:

Open PowerShell as Administrator Run: [Environment]::SetEnvironmentVariable("LCOW_API_PLATFORM_IF_OMITTED", "linux", "Machine") Now restart docker.

As next it will download the image and stop with the problem of #1486 ;)

>docker image pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
ca4f61b1923c: Extracting [==================================================>]     985B/985B
failed to register layer: failed to start service utility VM (applydiff 2ce369879a820bc01087b83ce7b664f3915527633fc119549c75a3d2b06a0977): container 2ce369879a820bc01087b83ce7b664f3915527633fc119549c75a3d2b06a0977_svm encountered an error during CreateContainer: failure in a Windows system

enbock avatar Jan 22 '18 20:01 enbock

Thank you. @enbock solution worked for me.

Also now Linux containers are used in the stable release, and with stable I'm not having this issue.

zicodes avatar Feb 01 '18 18:02 zicodes

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked

docker-robott avatar Jun 25 '20 03:06 docker-robott