-
Notifications
You must be signed in to change notification settings - Fork 350
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
Publish a container image for Apple M1 machines #798
Comments
The M1 is an ARM chip and the stack trace says |
@hazcod Can you confirm which docker image you're using? |
This is the official one, but it might be emulated by Docker for Mac via qemu I guess to x86? |
I assume you're using the default image and not alpine or buster. In any case, this should just work, but perhaps there's still an issue here with Docker? We'll investigate. |
How are you starting your container? I see there are some known issues with Docker on the M1 chip:
https://docs.docker.com/docker-for-mac/apple-silicon/#known-issues |
Note: the link above recommends running ARM64 containers on Apple Silicon. Recently distroless added support for ARM64.
|
We probably need to do something special to support ARM64 in the default container. Until then I think using the emulation flag as Eno described above is a suitable work around. |
For reference how I run it via Kubernetes on Docker for Mac (via a Helm template): apiVersion: apps/v1
kind: Deployment
metadata:
namespace: "{{ .Values.namespace }}"
name: "{{ .Values.name }}-api"
labels:
app: "{{ .Values.name }}"
owner: "{{ .Values.owner }}"
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: "{{ .Values.name }}"
component: "api"
strategy:
type: Recreate
template:
metadata:
labels:
app: "{{ .Values.name }}"
owner: "{{ .Values.owner }}"
component: "api"
annotations:
seccomp.security.alpha.kubernetes.io/pod: runtime/default
{{ if not .Values.developmentMode }}
# do not enable on Docker for Mac, since it doesn't support AppArmor
container.apparmor.security.beta.kubernetes.io/api: runtime/default
{{ end }}
spec:
restartPolicy: Always
{{ if not .Values.developmentMode }}
serviceAccountName: "{{ .Values.serviceAccount }}"
initContainers:
- image: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
name: workload-identity-initcontainer
command:
- '/bin/bash'
- '-c'
- |
curl -s -H 'Metadata-Flavor: Google' 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token' --retry 30 --retry-connrefused --retry-max-time 30 > /dev/null || exit 1
{{ end }}
containers:
-
imagePullPolicy: Always
image: eu.gcr.io/cloudsql-docker/gce-proxy:1.22.0
name: cloudsql-proxy
command:
- '/cloud_sql_proxy'
- '-enable_iam_login'
{{ if not .Values.developmentMode }}
- '-ip_address_types=PRIVATE'
{{ end }}
- '-instances={{ .Values.app.db.requests.instanceUrl }}=tcp:3126,{{ .Values.app.db.meta.instanceUrl }}=tcp:3127'
{{ if .Values.developmentMode }}
env:
-
name: GOOGLE_APPLICATION_CREDENTIALS
value: /sa.json
volumeMounts:
-
mountPath: /sa.json
name: {{.Values.name}}-api-sajson
readOnly: true
{{ end }}
resources:
requests:
cpu: 0.5
memory: 0.5Gi
limits:
cpu: 0.5
memory: 0.5Gi
securityContext:
readOnlyRootFilesystem: true
privileged: false
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop: [all]
seccompProfile:
type: RuntimeDefault
volumes:
{{ if .Values.developmentMode }}
-
hostPath:
path: {{ .Values.devServiceAccountFile}}
name: "{{.Values.name}}-api-sajson"
{{ end }} |
@hazcod I don't have access to an Apple Silicon machine presently. However, if there's interest you could build your own container by making two changes to the Dockerfile at the root of this project:
After those changes, you'll have an M1 friendly version of the Cloud SQL Auth proxy. But again, I don't have an Apple Silicon machine at the moment and can't verify myself. |
Peeking in here again for official arm64 images. :-) |
We have this prioritized internally for the first half of this year. Right now, there's other work in flight that takes priority (e.g., v2 proxy). |
Fixed by #1193. We'll have an M1 friendly container in the next release. |
Bug Description
Crash on Docker for Mac Kubernetes, M1 chip.
Stacktrace
Environment
./cloud_sql_proxy -version
): 1.22.0The text was updated successfully, but these errors were encountered: