Skip to content

Commit

Permalink
Fixes ppc64le setup for Knative (#36)
Browse files Browse the repository at this point in the history
We missed one script in
#19 which possibly was
due to bad wording at its call site. This is a script that downloads the
minirootfs for the given arch. It isn't actually minirootfs.

Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt authored Dec 5, 2023
1 parent 56662a2 commit 31228d5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ on:

jobs:
test:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2022 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# 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
Expand Down Expand Up @@ -29,13 +29,13 @@ COPY . /code/

# See from a previously published version to avoid pulling from Docker Hub (docker.io)
# This version is only used to install the real version
FROM ghcr.io/openzipkin/alpine:3.16.2 as install
FROM ghcr.io/openzipkin/alpine:3.18.5 as install

WORKDIR /code
# Conditions aren't supported in Dockerfile instructions, so we copy source even if it isn't used.
COPY --from=code /code/ .

# Alpine's minirootfs is mirrored and only 5MB. Build on demand instead of consuming docker.io pulls
# Alpine's minirootfs is mirrored and only 5MB. wget on demand instead of consuming docker.io pulls
WORKDIR /install

ARG alpine_version
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ This is an internal base layer primarily used in [docker-java](https://github.co

To browse the image, run it in interactive mode with TTY enabled like so:
```bash
docker run -ti --rm ghcr.io/openzipkin/alpine:3.18.2
docker run -ti --rm ghcr.io/openzipkin/alpine:3.18.5
/ #
```

## Release process
Build the `Dockerfile` using the current version from https://alpinelinux.org/downloads/:
```bash
# Note 3.18.2 not 3.18!
./build-bin/build 3.18.2
# Note 3.18.5 not 3.18!
./build-bin/build 3.18.5
```

Next, verify the built image matches that version:
```bash
docker run --rm openzipkin/alpine:test -c 'cat /etc/alpine-release'
3.18.2
3.18.5
```

To release the image, push a tag matching the arg to `build-bin/build` (ex `3.18.2`).
To release the image, push a tag matching the arg to `build-bin/build` (ex `3.18.5`).
This triggers a [GitHub Actions](https://github.com/openzipkin/docker-alpine/actions) job to push the image.
9 changes: 7 additions & 2 deletions alpine_minirootfs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# 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
Expand All @@ -17,11 +17,13 @@ set -eu

# This downloads and extracts the indicated version alpine-minirootfs into the current directory.

full_version=${1?full_version ex 3.18.2}
full_version=${1?full_version ex 3.18.5}
version=$(echo "${full_version}" | sed -En "s/^([0-9]+\.[0-9]+)\.[0-9]+$/\1/p")
patch=$(echo "${full_version}" | cut -f3 -d.)

# Normalize arch to what's available
#
# Note: s390x and ppc64le were added for Knative
arch=$(uname -m)
case ${arch} in
amd64* )
Expand All @@ -39,6 +41,9 @@ case ${arch} in
s390x* )
arch=s390x
;;
ppc64le* )
arch=ppc64le
;;
* )
>&2 echo "Unsupported arch: ${arch}"
exit 1;
Expand Down
7 changes: 6 additions & 1 deletion build-bin/docker/docker_arch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# 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
Expand All @@ -21,6 +21,8 @@
set -ue

# Normalize docker_arch to what's available
#
# Note: s390x and ppc64le were added for Knative
docker_arch=${DOCKER_ARCH:-$(uname -m)}
case ${docker_arch} in
amd64* )
Expand All @@ -38,6 +40,9 @@ case ${docker_arch} in
s390x* )
docker_arch=s390x
;;
ppc64le* )
docker_arch=ppc64le
;;
* )
>&2 echo "Unsupported DOCKER_ARCH: ${docker_arch}"
exit 1;
Expand Down
5 changes: 3 additions & 2 deletions build-bin/docker/docker_push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2020 The OpenZipkin Authors
# Copyright 2023 The OpenZipkin Authors
#
# 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
Expand Down Expand Up @@ -64,7 +64,8 @@ for repo in ${docker_repos}; do
done

docker_args=$($(dirname "$0")/docker_args ${version})
docker_archs=${DOCKER_ARCHS:-amd64 arm64 s390x}
# Note: s390x and ppc64le were added for Knative
docker_archs=${DOCKER_ARCHS:-amd64 arm64 s390x ppc64le}

echo "Will build the following architectures: ${docker_archs}"

Expand Down

0 comments on commit 31228d5

Please sign in to comment.