By eaglemoor
Hi, I create docker image with bash for run 2 application
#!/bin/sh
./service-linux-one
./service-linux
If I run docker local docker run -it --rm {name} all work fine. I catch error if deploy on do app
[2021-05-21T19:37:47.694599036Z] starting container: starting non-root container [bash ./run.sh]: creating process: failed to load /usr/bin/bash: exec format error
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @eaglemoor,
It looks like that you don’t have bash installed inside the container. You could instead try using sh:
RUN /bin/sh
Or alternatively, you could install bash. Depending on the Docker image that you are using you could add an install step in your Dockerfile. For example if you are using Apline as your base image this would look like this:
RUN apk update && apk add bash
If you are using Ubuntu or Debian it would need to be updated to apt update && apt install bash.
Let me know how it goes. Regards, Bobby
in case someone else comes across this. i encountered this issue when building images on the m1 max macbook (ARM64).
i believe this is because the VM host DO uses expects AMD64 only.
you can confirm this with:
docker inspect <image ID> --format '{{.Architecture}}'
# you can get image ID with
docker image ls
when built through docker desktop on macOS you get
docker inspect <image ID> --format '{{.Architecture}}'
arm64
when built on a native linux docker host you get
docker inspect <image ID> --format '{{.Architecture}}'
amd64
if you get arm64 then you will see this issue when you deploy.
If you are using an Apple Silicon to build your images, you need to use amd64 images (default is arm64 on those macs which is not supported by DO)
FROM --platform=linux/amd64 node:18-alpine
# Rest of your docker file...
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.