samos123 / gke-node-ca-importer

12 stars 3 forks source link

exec /bin/sh: exec format error #2

Open devenes opened 1 year ago

devenes commented 1 year ago

Getting the following error while trying to run customization container in DaemonSet:

exec /bin/sh: exec format error

It might be occurred because of the architecture difference between ubuntu image in the Dockerfile and Container OS node in the Google Kubernetes Engine.

You can see the details of image:

$ docker inspect
        "Architecture": "arm64",
        "Variant": "v8",
        "Os": "linux",
        "Size": 69205056,

COS is not arm64 by default in GKE.

devenes commented 1 year ago

The valid Dockerfile format is:

FROM ubuntu@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea

COPY myCA.pem ./myCA.pem

COPY insert-ca.sh ./insert-ca.sh

RUN chmod +x ./insert-ca.sh

CMD ["./insert-ca.sh"]

1) Need to use supported architecture of Ubuntu latest image 2) Got an error while running the script in /usr/sbin/

🚨 But still update-ca-certificates command currently can't merge new certificates.