Skip to content

Commit

Permalink
Support recent multiarch build on DockerHub
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Dec 23, 2019
1 parent 4a901b6 commit 68ac193
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Dockerfile.template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,31 @@ FROM alpine:3.9
<% end %>
<% else %>
<% if is_armhf %>
# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
RUN apk add curl --no-cache
RUN curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .

FROM arm32v7/ruby:2.6-buster
COPY --from=builder /go/qemu-arm-static /usr/bin/
<% elsif is_arm64 %>
# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
RUN apk add curl --no-cache
RUN curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static .

FROM arm64v8/ruby:2.6-buster
COPY --from=builder /go/qemu-aarch64-static /usr/bin/
<% else %>
FROM ruby:2.6-slim-buster
<% end %>
<% end %>
<% end %>
LABEL maintainer "Fluentd developers <fluentd@googlegroups.com>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="<%= fluentd_ver %>"
<% if is_armhf %>
<% if is_armhf || is_arm64 %>
ARG CROSS_BUILD_START="cross-build-start"
ARG CROSS_BUILD_END="cross-build-end"
RUN [ ${CROSS_BUILD_START} ]
Expand Down Expand Up @@ -179,7 +193,7 @@ USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

<% if is_armhf %>
<% if is_armhf || is_arm64 %>
RUN [ ${CROSS_BUILD_END} ]
<% end %>
<% end %>
11 changes: 11 additions & 0 deletions v1.8/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
RUN apk add curl --no-cache
RUN curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static .

FROM arm64v8/ruby:2.6-buster
COPY --from=builder /go/qemu-aarch64-static /usr/bin/
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.8.0"
ARG CROSS_BUILD_START="cross-build-start"
ARG CROSS_BUILD_END="cross-build-end"
RUN [ ${CROSS_BUILD_START} ]
ENV TINI_VERSION=0.18.0

# Do not split this into multiple RUN!
Expand Down Expand Up @@ -62,3 +72,4 @@ USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

RUN [ ${CROSS_BUILD_END} ]
7 changes: 7 additions & 0 deletions v1.8/armhf/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
RUN apk add curl --no-cache
RUN curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .

FROM arm32v7/ruby:2.6-buster
COPY --from=builder /go/qemu-arm-static /usr/bin/
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.8.0"
ARG CROSS_BUILD_START="cross-build-start"
Expand Down

0 comments on commit 68ac193

Please sign in to comment.