Skip to content

Commit

Permalink
Standard Dockerfiles, build and push for all archs
Browse files Browse the repository at this point in the history
  • Loading branch information
deitch committed Aug 6, 2018
1 parent c1b6208 commit 07990c4
Show file tree
Hide file tree
Showing 16 changed files with 391 additions and 179 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore everything except the filesystem that gets copied in
# Ignore everything except the filesystem that gets copied in and the generated binaries
*
!filesystem
!filesystem
!dist/bin
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ certs
.coverage
cover
*.tar
*.created
*.created-*
docker
**/*.sw[pon]
birdcl
Expand Down
27 changes: 0 additions & 27 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
25 changes: 17 additions & 8 deletions Dockerfile-ppc64le → Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
# Copyright IBM Corp. 2017
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,16 +11,26 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ppc64le/alpine:3.8
MAINTAINER David Wilder <[email protected]>
ARG BIRD_IMAGE=calico/bird:latest
FROM ${BIRD_IMAGE} as bird

# Set the minimum Docker API version required for libnetwork.
ENV DOCKER_API_VERSION 1.21
FROM alpine:3.8
MAINTAINER Tom Denham <[email protected]>

# Populated by build with the git version.
ARG ver="n/a"
ARG ARCH=amd64
ENV NODE_VERSION=$ver

# Install remaining runtime deps required for felix from the global repository
RUN apk add --no-cache ip6tables ipset iputils iproute2 conntrack-tools runit file
RUN apk add --no-cache ip6tables ipset iputils iproute2 conntrack-tools runit

# Copy our bird binaries in
COPY --from=bird /bird* /bin/

# Copy in the filesystem - this contains felix, bird, gobgp etc...
COPY filesystem /
# Copy in the filesystem - this contains felix, calico-bgp-daemon etc...
COPY filesystem/ /
# Copy in the calico-node binary
COPY dist/bin/calico-node-${ARCH} /bin/calico-node

CMD ["start_runit"]
48 changes: 48 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG QEMU_IMAGE=calico/go-build:latest
ARG BIRD_IMAGE=calico/bird:latest

FROM ${QEMU_IMAGE} as qemu
FROM ${BIRD_IMAGE} as bird

FROM arm64v8/alpine:3.8 as base
MAINTAINER Tom Denham <[email protected]>

ARG ARCH=arm64

# Populated by build with the git version.
ARG ver="n/a"
ENV NODE_VERSION=$ver

# Enable non-native builds of this image on an amd64 hosts.
# This must be the first RUN command in this file!
# we only need this for the intermediate "base" image, so we can run all the apk and other commands
# when running on a kernel >= 4.8, this will become less relevant
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin/

# Install remaining runtime deps required for felix from the global repository
RUN apk add --no-cache ip6tables ipset iputils iproute2 conntrack-tools runit

# Copy our bird binaries in
COPY --from=bird /bird* /bin/

# Copy in the filesystem - this contains felix, calico-bgp-daemon etc...
COPY filesystem/ /
# Copy in the calico-node binary
COPY dist/bin/calico-node-${ARCH} /bin/calico-node

RUN rm /usr/bin/qemu-aarch64-static

CMD ["start_runit"]
48 changes: 48 additions & 0 deletions Dockerfile.ppc64le
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
# Copyright IBM Corp. 2017
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG QEMU_IMAGE=calico/go-build:latest
ARG BIRD_IMAGE=calico/bird:latest

FROM ${QEMU_IMAGE} as qemu
FROM ${BIRD_IMAGE} as bird

FROM ppc64le/alpine:3.8
MAINTAINER David Wilder <[email protected]>

ARG ARCH=ppc64le

# Set the minimum Docker API version required for libnetwork.
ENV DOCKER_API_VERSION 1.21

# Enable non-native builds of this image on an amd64 hosts.
# This must be the first RUN command in this file!
# we only need this for the intermediate "base" image, so we can run all the apk and other commands
# when running on a kernel >= 4.8, this will become less relevant
COPY --from=qemu /usr/bin/qemu-${ARCH}-static /usr/bin/

# Install remaining runtime deps required for felix from the global repository
RUN apk add --no-cache ip6tables ipset iputils iproute2 conntrack-tools runit file

# Copy our bird binaries in
COPY --from=bird /bird* /bin/

# Copy in the filesystem - this contains felix, calico-bgp-daemon etc...
COPY filesystem/ /
# Copy in the calico-node binary
COPY dist/bin/calico-node-${ARCH} /bin/calico-node

RUN rm /usr/bin/qemu-${ARCH}-static

CMD ["start_runit"]
24 changes: 22 additions & 2 deletions Dockerfile-s390x → Dockerfile.s390x
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,36 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG QEMU_IMAGE=calico/go-build:latest
ARG BIRD_IMAGE=calico/bird:latest

FROM ${QEMU_IMAGE} as qemu
FROM ${BIRD_IMAGE} as bird

FROM s390x/alpine:3.8
MAINTAINER LoZ Open Source Ecosystem (https://www.ibm.com/developerworks/community/groups/community/lozopensource)

ARG ARCH=s390x
# Set the minimum Docker API version required for libnetwork.
ENV DOCKER_API_VERSION 1.21

# Enable non-native builds of this image on an amd64 hosts.
# This must be the first RUN command in this file!
# we only need this for the intermediate "base" image, so we can run all the apk and other commands
# when running on a kernel >= 4.8, this will become less relevant
COPY --from=qemu /usr/bin/qemu-${ARCH}-static /usr/bin/

# Install remaining runtime deps required for felix from the global repository
RUN apk add --no-cache ip6tables ipset iputils iproute2 conntrack-tools runit file

# Copy in the filesystem - this contains felix, bird, gobgp etc...
COPY filesystem /
# Copy our bird binaries in
COPY --from=bird /bird* /bin/

# Copy in the filesystem - this contains felix, calico-bgp-daemon etc...
COPY filesystem/ /
# Copy in the calico-node binary
COPY dist/bin/calico-node-${ARCH} /bin/calico-node

RUN rm /usr/bin/qemu-${ARCH}-static

CMD ["start_runit"]
Loading

0 comments on commit 07990c4

Please sign in to comment.