hypriot / rpi-traefik

Build an ARM docker image for Træfɪk, a modern reverse proxy
29 stars 10 forks source link

Wrong Image Architecture #29

Closed whatever4711 closed 7 years ago

whatever4711 commented 7 years ago

The image is delivered with "Architecture": "amd64", and can not be start on a RPi swarm with Docker Version 17.06.

StefanScherer commented 7 years ago

Are you able to start another image with 17.06 in a swarm?

StefanScherer commented 7 years ago

As we build this image on Travis the Architecture shows amd64

$ curl -sL https://registry.hub.docker.com/v2/repositories/hypriot/rpi-traefik/tags/latest | jq .
{
  "name": "latest",
  "full_size": 28200496,
  "images": [
    {
      "size": 28200496,
      "architecture": "amd64",
      "variant": null,
      "features": null,
      "os": "linux",
      "os_version": null,
      "os_features": null
    }
  ],
  "id": 3172980,
  "repository": 709170,
  "creator": 560640,
  "last_updater": 561768,
  "last_updated": "2017-07-07T09:06:28.177110Z",
  "image_id": null,
  "v2": true
}

But running this image as container or as service normally isn't blocked by the ARM Docker engine. With 17.06 I have problems running services in swarm mode with either such cross built images as well as natively built images (like stefanscherer/whoami:test)

Only issue with such ARM images built on Travis is drafting a multi-arch manifest list with the upcoming docker manifest command. You have to annotate the image to be an arm image as I have done it in https://github.com/StefanScherer/whoami/commit/8b51c87d1c3dd19b423fea1f60483539179ce336 At the moment I prefer the manifest-tool which can do this in one step https://github.com/StefanScherer/whoami/commit/aaa30d3d2b1f4bf898f5194a6c3ac8d73820d1c3

StefanScherer commented 7 years ago

@whatever4711 see also my investigations with swarm mode on different RPi OS'es in https://github.com/hypriot/image-builder-rpi/pull/176

StefanScherer commented 7 years ago

@whatever4711 There is a workaround to start swarm mode services, just add --no-resolve-image. A "Better Architecture comparison for Platform filter" was added two months ago, but this does not take care of different armv6l, armv7l node architecture <-> arm image architecture.

whatever4711 commented 7 years ago

@StefanScherer thanks for the work-around. Hopefully, this architecture selection problem will be fixed in the near future. I also tried @firecyberice multiarch traefik build for amd64 and arm, which provides correct architecture tags, but in Swarm mode the arm images were not added to the supported platform field.

However, I think for the future the images on docker hub / cloud should be provided with the correct platforms tag.

nsteinmetz commented 7 years ago

@whatever4711, if you wish or if it can help you, you can test with nsteinmetz/traefik-arm image.

I just built it on my rpi with the same dockerfile as for hypriot/rpi-traefik.

whatever4711 commented 7 years ago

@nsteinmetz, I tried your image, but it is not firing up the container in swarm mode. For now only --no-resolve-image is a usable workaround. Or if you like to use stacks: docker stack deploy --resolve-image never selection_033 My cluster consists of armv7l SBCs.

firecyberice commented 7 years ago

There is an issue at swarmkit

nsteinmetz commented 7 years ago

With new official images provided by Traefik team (see Readme for instructions) and Support of manifest, you may test again and switch to official images (as for hypriot/rpi-traefik, it remains amd64 and that I no longer plan to update the repo due to the official images...)

nsteinmetz commented 7 years ago

Confirmed ; Architecture is now arm

[
    {
        "Id": "sha256:4acff2fff85bc5238a00435057793988786cfd055f93b9152e8a78934b8b2037",
        "RepoTags": [
            "traefik:latest"
        ],
        "RepoDigests": [
            "traefik@sha256:1d152e1b4c8161d4752684a4b51ef4f399ef76779adab085cf16aa268b8f6623"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-09-09T00:47:08.590765573Z",
        "Container": "96bb690c54d5ad3b475c1de0a08ccf35c025c7e74173b947374507ae5d96882b",
        "ContainerConfig": {
            "Hostname": "96bb690c54d5",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "LABEL org.label-schema.vendor=Containous org.label-schema.url=https://traefik.io org.label-schema.name=Traefik org.label-schema.description=A modern reverse-proxy org.label-schema.version=v1.3.8 org.label-schema.docker.schema-version=1.0"
            ],
            "Image": "sha256:5b1bd81bfdcb791a315659a8f5dc5a2ef9f973ef469d4c9b9acec65a128a9511",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/traefik"
            ],
            "OnBuild": null,
            "Labels": {
                "org.label-schema.description": "A modern reverse-proxy",
                "org.label-schema.docker.schema-version": "1.0",
                "org.label-schema.name": "Traefik",
                "org.label-schema.url": "https://traefik.io",
                "org.label-schema.vendor": "Containous",
                "org.label-schema.version": "v1.3.8"
            }
        },
        "DockerVersion": "17.06.1-ce",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": null,
            "Image": "sha256:5b1bd81bfdcb791a315659a8f5dc5a2ef9f973ef469d4c9b9acec65a128a9511",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/traefik"
            ],
            "OnBuild": null,
            "Labels": {
                "org.label-schema.description": "A modern reverse-proxy",
                "org.label-schema.docker.schema-version": "1.0",
                "org.label-schema.name": "Traefik",
                "org.label-schema.url": "https://traefik.io",
                "org.label-schema.vendor": "Containous",
                "org.label-schema.version": "v1.3.8"
            }
        },
        "Architecture": "arm",
        "Os": "linux",
        "Size": 37326575,
        "VirtualSize": 37326575,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/f9dc3014b09b76083ce254ce048c14e939a1f09216d8b24a5e1a4bf56de3e0a1/diff",
                "MergedDir": "/var/lib/docker/overlay2/f47009d90424069058deacd642676aef575885875a3117e9b812e6761e0fc7d2/merged",
                "UpperDir": "/var/lib/docker/overlay2/f47009d90424069058deacd642676aef575885875a3117e9b812e6761e0fc7d2/diff",
                "WorkDir": "/var/lib/docker/overlay2/f47009d90424069058deacd642676aef575885875a3117e9b812e6761e0fc7d2/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:c55086d0f35039ed935fe70b934630f5213feb4057fa1a71823514962f9d1b26",
                "sha256:85f5c3910617dc950fb74fec92d10e88f74c0c9e8faded095e1757c2c2356713"
            ]
        }
    }
]
StefanScherer commented 7 years ago

Yes, the official images for ARM are built on real ARM devices, so the Architecture entry also is arm. Thanks @nsteinmetz for maintaining this image. It's great to see more and more official images for ARM, so the community can switch over to these.