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

Provide arm64 Docker Image #50

Closed
kylerankin opened this issue Mar 11, 2020 · 6 comments
Closed

Provide arm64 Docker Image #50

kylerankin opened this issue Mar 11, 2020 · 6 comments
Labels
container enhancement New feature or request
Milestone

Comments

@kylerankin
Copy link

I am looking to provide dangerzone as a default application on the Librem 5 phone hardware (running PureOS, which is based off of Debian Buster). As the dangerzone package is architecture-independent I have been able to install the buster Debian package and run it on the phone (it doesn't quite fit on the default small screen resolution but I'm working on a PR to help with that).

Unfortunately the only docker image that is provided is for amd64. This causes docker to fail on platforms that don't support amd64. Please provide an alternate docker image built for arm64 platforms.

@micahflee
Copy link
Contributor

The containers are built automatically using CircleCI. Here's the state of CircleCI's arm64 support: https://ideas.circleci.com/ideas/CCI-I-900

@kylerankin
Copy link
Author

Hmm, looks like they've been sitting on the issue for a year. That doesn't make the prospect of arm64 images too promising.

@micahflee micahflee added the enhancement New feature or request label Jun 3, 2020
@andrewcrook
Copy link

Would be useful for when Apple Silicon devices with Big Sur come out and Docker for Apple silicon ( although it might run in a VM with a guest ARM Linux like the current version for Intel Macs uses Linux)

@gmarmstrong
Copy link
Contributor

CircleCI now supports ARM as resource class, but not with their Docker executor. The issue is tracked here.

@gmarmstrong
Copy link
Contributor

Building a native image on an ARM machine (by removing the --platform linux/amd64 argument from container.py and build-image.sh and then rebuilding the image) gives a remarkable improvement to document conversion speed (over 3 times faster):

ARM image on an ARM machine (Apple Silicon/M1) (~5 seconds):

(dangerzone-H9rmGDxH-py3.10) guthrie@macbook dangerzone % time ./dev_scripts/dangerzone-cli test_docs/sample.pdf                                                     typing
╭──────────────────────────╮
│           ▄██▄           │
│          ██████          │
│         ███▀▀▀██         │
│        ███   ████        │
│       ███   ██████       │
│      ███   ▀▀▀▀████      │
│     ███████  ▄██████     │
│    ███████ ▄█████████    │
│   ████████████████████   │
│    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    │
│                          │
│    Dangerzone v0.3.1     │
│ https://dangerzone.rocks │
╰──────────────────────────╯

Converting document to safe PDF
> /usr/local/bin/Docker run --network none -v /Users/guthrie/Projects/dangerzone/test_docs/sample.pdf:/tmp/input_file -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpe821bbr8/pixels:/dangerzone' dangerzone.rocks/dangerzone /usr/bin/python3 /usr/local/bin/dangerzone.py document-to-pixels
3% Separating document into pages
5% Converting page 1/4 to pixels
16% Converting page 2/4 to pixels
27% Converting page 3/4 to pixels
38% Converting page 4/4 to pixels
50% Converted document to pixels
> /usr/local/bin/Docker run --network none -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpe821bbr8/pixels:/dangerzone' -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpe821bbr8/safe:/safezone' -e OCR=0 -e OCR_LANGUAGE=None dangerzone.rocks/dangerzone /usr/bin/python3 /usr/local/bin/dangerzone.py pixels-to-pdf
50% Converting page 1/4 from pixels to PDF
61% Converting page 2/4 from pixels to PDF
72% Converting page 3/4 from pixels to PDF
83% Converting page 4/4 from pixels to PDF
95% Merging 4 pages into a single PDF
97% Compressing PDF
100% Safe PDF created

Safe PDF created successfully
/Users/guthrie/Projects/dangerzone/test_docs/sample-safe.pdf
./dev_scripts/dangerzone-cli test_docs/sample.pdf  0.19s user 0.12s system 6% cpu 5.016 total

AMD image on the same ARM machine (~16 seconds):

(dangerzone-H9rmGDxH-py3.10) guthrie@macbook dangerzone % time ./dev_scripts/dangerzone-cli test_docs/sample.pdf                                                     typing
╭──────────────────────────╮
│           ▄██▄           │
│          ██████          │
│         ███▀▀▀██         │
│        ███   ████        │
│       ███   ██████       │
│      ███   ▀▀▀▀████      │
│     ███████  ▄██████     │
│    ███████ ▄█████████    │
│   ████████████████████   │
│    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    │
│                          │
│    Dangerzone v0.3.1     │
│ https://dangerzone.rocks │
╰──────────────────────────╯

Converting document to safe PDF
> /usr/local/bin/Docker run --network none -v /Users/guthrie/Projects/dangerzone/test_docs/sample.pdf:/tmp/input_file -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpv3ol9rj3/pixels:/dangerzone' dangerzone.rocks/dangerzone /usr/bin/python3 /usr/local/bin/dangerzone.py document-to-pixels
Invalid JSON returned from container: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

3% Separating document into pages
5% Converting page 1/4 to pixels
16% Converting page 2/4 to pixels
27% Converting page 3/4 to pixels
38% Converting page 4/4 to pixels
50% Converted document to pixels
> /usr/local/bin/Docker run --network none -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpv3ol9rj3/pixels:/dangerzone' -v '/Users/guthrie/Library/Application Support/dangerzone/tmp/tmpv3ol9rj3/safe:/safezone' -e OCR=0 -e OCR_LANGUAGE=None dangerzone.rocks/dangerzone /usr/bin/python3 /usr/local/bin/dangerzone.py pixels-to-pdf
Invalid JSON returned from container: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

50% Converting page 1/4 from pixels to PDF
61% Converting page 2/4 from pixels to PDF
72% Converting page 3/4 from pixels to PDF
83% Converting page 4/4 from pixels to PDF
95% Merging 4 pages into a single PDF
97% Compressing PDF
100% Safe PDF created

Safe PDF created successfully
/Users/guthrie/Projects/dangerzone/test_docs/sample-safe.pdf
./dev_scripts/dangerzone-cli test_docs/sample.pdf  0.18s user 0.08s system 1% cpu 15.978 total
(dangerzone-H9rmGDxH-py3.10) guthrie@macbook dangerzone % 

@apyrgio apyrgio added this to the 0.4.1 milestone Jan 24, 2023
deeplow added a commit that referenced this issue Feb 9, 2023
deeplow added a commit that referenced this issue Feb 16, 2023
Remove --patform args completely so that by default we build natively
on each platform.

Partial fix for #50
@deeplow
Copy link
Contributor

deeplow commented Feb 21, 2023

The original issue was for providing an arm64 image. With #337 (which will be shipped with the 0.4.1 version) this will already be the case. However, users will have to manually copy over the image since we don't distribute .deb with the arm64 image. To overcome this one will have to build from source on a linux arm system, at the moment.

We don't plan on supporting linux 64 arm systems at the moment. However, for macOS, we will support arm-based macs (apple silicon / m1 / m2).

With that said, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
container enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants