# Docker buildx problems

**URL:** <https://travis-ci.community/t/docker-buildx-problems/11017>\
**Category:** Enterprise\
**Tags:** travis-build\
**Created:** [January 12, 2021, 5:04am UTC](https://travis-ci.community/t/docker-buildx-problems/11017 "2021-01-12T05:04:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolarUltima](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/solarultima/32/4019_2.png) [@SolarUltima](https://travis-ci.community/u/SolarUltima)\
**Post date:** [January 12, 2021, 5:04am UTC](https://travis-ci.community/t/docker-buildx-problems/11017/1 "2021-01-12T05:04:17Z")

</div>

Hey Travis community,

Tying to build image for platform `ppc64le` via Docker `buildx` and Buildkit on our enterprise Travis CI instance.

Here’s our `.travis.yml`

```auto
os: linux
dist: bionic
language: shell
branches:
  only:
    - master
before_install:
  - set -e
  # Configure environment so changes are picked up when the Docker daemon is restarted after upgrading
  - echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
  - export DOCKER_CLI_EXPERIMENTAL=enabled
  - sudo rm -rf /var/lib/apt/lists/*
  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
  - mkdir -vp ~/.docker/cli-plugins/
  - curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
  - chmod a+x ~/.docker/cli-plugins/docker-buildx
jobs:
  include:
    - stage: build and push docker image
      script:
        - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin  
        - sudo docker buildx build --platform linux/ppc64le --tag myimage:ppc64le -f src/main/docker/Dockerfile.ppc64 --push .

```

Build will fail on error: # if not instated on dockerfile

```auto
$ sudo docker buildx build --platform linux/ppc64le --tag myimage:ppc64le -f src/main/docker/Dockerfile.ppc64 --push .
unknown flag: --platform
See 'docker --help'.
Usage: docker [OPTIONS] COMMAND

```

`buildx` is not embedded, but `experimental_cli` is, so kind of stuck… Any ideas about how to enable `buildx` on Travis CI?

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [January 12, 2021, 5:10am UTC](https://travis-ci.community/t/docker-buildx-problems/11017/2 "2021-01-12T05:10:02Z")

</div>

From what I can see you are missing this in your `before_install` Travis hook for this multiarch build:

```auto
  - mkdir -vp ~/.docker/cli-plugins/
  - curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
  - chmod a+x ~/.docker/cli-plugins/docker-buildx

```

Using `cURL` and making sure `docker-buildx` has proper persmissions is key here, so that’s why there’s `chmod`. See if this works, I’m almost for certain it will work for your Docker `buildx` problem.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [January 13, 2021, 8:40am UTC](https://travis-ci.community/t/docker-buildx-problems/11017/3 "2021-01-13T08:40:32Z")

</div>

Hey great this solved your issue @SolarUltima, any other info you can give us on the success? As it helps the whole community.

Thanks,

Montana.
