I am tying to build an Alpine-based Docker image for Firebase CLI tool. Below is the Dockerfile:
FROM alpine
RUN apk update; \
apk add --no-cache openjdk21-jre; \
wget --output-file /usr/local/bin/firebase https://firebase.tools/bin/linux/latest; \
chmod +x /usr/local/bin/firebase;
EXPOSE 9099
EXPOSE 8080
EXPOSE 5000
EXPOSE 5001
EXPOSE 8085
EXPOSE 9000
EXPOSE 9199
EXPOSE 9299
EXPOSE 4000
VOLUME [ "/opt/firebase" ]
WORKDIR /opt/firebase
CMD [ "firebase" ]
Not much is happening here as you can see. However, I get exec format error
when I run a container off of this image. I have been searching for solutions all over the internet. And while I see this "architecture mismatch" issue causing this kind of error, that does not seem to be applicable for me. As I am getting this error while building the image and running the container on the same machine. Can anyone point me at the exact issue this is happening for?
It looks like the firebase
binary is NOT supported by Alpine Linux yet. So I switched to debian
's slim
image and I got it working. This is the Dockerfile I've used:
FROM debian:stable-slim
RUN apt update && apt install --yes default-jre
ADD --chmod=700 https://firebase.tools/bin/linux/latest /usr/local/bin/firebase
EXPOSE 9099
EXPOSE 8080
EXPOSE 5000
EXPOSE 5001
EXPOSE 8085
EXPOSE 9000
EXPOSE 9199
EXPOSE 9299
EXPOSE 4000
ENTRYPOINT [ "firebase" ]