Skip to content

Commit

Permalink
feat: Implement debug docker for arm64 platform
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianbeier committed Jan 28, 2025
1 parent 51369fd commit dd2d6ad
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,15 @@ debug-linux-docker-amd64: release-dirs
-ldflags '-extldflags "-static" $(DEBUG_LDFLAGS) $(DOCKER_LDFLAGS)' \
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-amd64' \
./cmd/$(NAME)

debug-linux-docker-arm64: release-dirs
GOOS=linux \
GOARCH=arm64 \
go build \
-gcflags="all=-N -l" \
-tags 'netgo $(TAGS)' \
-buildmode=exe \
-trimpath \
-ldflags '-extldflags "-static" $(DEBUG_LDFLAGS) $(DOCKER_LDFLAGS)' \
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm64' \
./cmd/$(NAME)
3 changes: 3 additions & 0 deletions changelog/unreleased/enhancement-debug-docker-arm64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Implement debug docker for arm64 platform

https://github.com/owncloud/ocis/pull/10940
41 changes: 41 additions & 0 deletions ocis/docker/Dockerfile.linux.debug.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM arm64v8/alpine:latest

ARG VERSION=""
ARG REVISION=""

RUN apk add --no-cache attr bash ca-certificates curl delve inotify-tools libc6-compat mailcap tree vips patch && \
echo 'hosts: files dns' >| /etc/nsswitch.conf

LABEL maintainer="ownCloud GmbH <[email protected]>" \
org.opencontainers.image.title="ownCloud Infinite Scale" \
org.opencontainers.image.vendor="ownCloud GmbH" \
org.opencontainers.image.authors="ownCloud GmbH" \
org.opencontainers.image.description="oCIS - ownCloud Infinite Scale is a modern file-sync and share platform" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.documentation="https://github.com/owncloud/ocis" \
org.opencontainers.image.url="https://hub.docker.com/r/owncloud/ocis" \
org.opencontainers.image.source="https://github.com/owncloud/ocis" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}"

RUN addgroup -g 1000 -S ocis-group && \
adduser -S --ingroup ocis-group --uid 1000 ocis-user --home /var/lib/ocis

RUN mkdir -p /var/lib/ocis && \
chown -R ocis-user:ocis-group /var/lib/ocis && \
chmod -R 751 /var/lib/ocis && \
mkdir -p /etc/ocis && \
chown -R ocis-user:ocis-group /etc/ocis && \
chmod -R 751 /etc/ocis

VOLUME [ "/var/lib/ocis", "/etc/ocis" ]
WORKDIR /var/lib/ocis

USER 1000

EXPOSE 9200/tcp

ENTRYPOINT ["/usr/bin/ocis"]
CMD ["server"]

COPY dist/binaries/ocis-linux-arm64 /usr/bin/ocis

0 comments on commit dd2d6ad

Please sign in to comment.