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

Raspberry Pi: App build error #5

Open
ardenor opened this issue Jan 13, 2021 · 10 comments
Open

Raspberry Pi: App build error #5

ardenor opened this issue Jan 13, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@ardenor
Copy link

ardenor commented Jan 13, 2021

Hi there!

When docker-compose up runs, the app and db seem to exit.

When attempting to docker-compose up the app alone, it gives the error: /app: line 1: syntax error: unexpected "("

Thanks :)

@marcusolsson
Copy link
Contributor

Thanks for letting us know!

I'm unable to reproduce this. Could you please share the OS you're running, and the Docker version you're using?

@marcusolsson marcusolsson added the bug Something isn't working label Jan 13, 2021
@bose2
Copy link

bose2 commented Feb 17, 2021

Hello,

Is Docker on Raspberry Pi 4 with Ubuntu OS supported for the tutorial environment?

Have the following error "standard_init_linux.go:219: exec user process caused: exec format error" on container "tutorial-environment_db_1"

And Permissions error "/bin/sh: /app: Permission denied" on "tutorial-environment_app_1"

Thanks,
Ed

@LoLo2207
Copy link

LoLo2207 commented Mar 31, 2021

Hi there!

When docker-compose up runs, the app and db seem to exit.

When attempting to docker-compose up the app alone, it gives the error: /app: line 1: syntax error: unexpected "("

Thanks :)

Same here, also on a Raspberry Pi 4, but with Raspbian 10 (buster)

pi@raspi:~/source/repos/tutorial-environment $ docker --version
Docker version 20.10.5, build 55c4c88
pi@raspi:~/source/repos/tutorial-environment $ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 6
  Running: 5
  Paused: 0
  Stopped: 1
 Images: 11
 Server Version: 20.10.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.17-v7l+
 Operating System: Raspbian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: armv7l
 CPUs: 4
 Total Memory: 3.737GiB
 Name: raspi
 ID: 4TAW:VU6V:DXE3:352M:CYLF:CQK3:KL4S:LQG2:THXN:FYC2:BBTA:RC7H
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory TCP limit support
WARNING: No oom kill disable support

@marcusolsson
Can we get the source code of that binary and compile it manually? Or a new version.

Thanks

@maonat
Copy link

maonat commented Sep 1, 2021

I was able to reproduce on my raspberry PI 4B 4GB with ubuntu_server_21 installed.
Installation clean after update/upgrade did cause same issue.

Perhaps same issue can be reproduced with ubuntu server Docker image running inside the tutorial.
@marcusolsson

On my macOS 11.4 worked like a charm.

@zuchka zuchka changed the title App build error Raspberry Pi: App build error May 19, 2022
@bitsy
Copy link

bitsy commented Dec 2, 2022

I'm also experiencing a similar issue. I'm running Docker 20.10.21 on a Raspberry Pi 3B+ running Pi OS Bullseye. I also use Portainer to manage Docker. Here's the log output I get from Portainer when the app container exits:
/app: line 1: syntax error: unexpected "("
The db container produces this error:
exec /db: exec format error

Any thoughts?

@markr111
Copy link

got this working on raspberry pi: changes in https://github.com/markr111/tutorial-environment/tree/ARM_DEMO

(not submitting as PR to grafana because it will break non-ARM architectures)

/app was compiled and bundled in the app repo as an AMD64 binary.
Fixed by modifying the ./app Dockerfile to compile main.go instead of copying incompatible executable into docker image. Not perfect, could create a multistage docker build.

Also - the db container was exiting on rpi for the same reason (incompatible arch), docker hub has a pi-specific tns-db image which docker-compose.yml now points at (this will break tns-db on other architectures)

caveat: I haven't run the entire demo against this branch so things might still be broken - but no more errors on startup.

@andriandreo
Copy link

/app was compiled and bundled in the app repo as an AMD64 binary.
Fixed by modifying the ./app Dockerfile to compile main.go instead of copying incompatible executable into docker image. Not perfect, could create a multistage docker build.

Thanks for the contribution! I'm afraid I still can't get it to work properly: same app-1 | /app: line 1: syntax error: unexpected "(" exit error from docker compose logs app

@markr111
Copy link

@andriandreo - /app shouldn't exist (it's at /src/app)

have you switched to the ARM_DEMO branch?

@andriandreo
Copy link

andriandreo commented Nov 28, 2023

@markr111

have you switched to the ARM_DEMO branch?

Yes, of course, but something is wrong with the app file, that error persists

@markr111
Copy link

try docker compose build - this should rebuild the app directory and create a new image with the fix
then docker compose up -d
you might still be launching the broken app image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants