@cryptotaxi247 / kubo / commits / b9240fe43

refactor(docker): publish images under both names

This ensures we keep publishing the same image under both names: $ ./bin/get-docker-tags.sh $(date -u +%F) 88d88158c master ...chore/rename-to-banana ipfs/kubo:master-2022-06-21-88d8815 ipfs/go-ipfs:master-2022-06-21-88d8815 ipfs/kubo:master-latest ipfs/go-ipfs:master-latest

Marcin Rataj committed Jun 21, 2022 at 14:20 UTC b9240fe432395e3d6abc0d823cadf0c4f0ab5205
4 files changed +14 -8
.github/workflows/docker-image.yml
+3 -2
@@ -11,11 +11,12 @@ on:
11
12 jobs:
13 push_to_registry:
14 - if: github.repository == 'ipfs/go-ipfs' || github.event_name == 'workflow_dispatch'
14 + if: github.repository == 'ipfs/go-ipfs' || github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
15 name: Push Docker image to Docker Hub
16 runs-on: ubuntu-latest
17 env:
18 - IMAGE_NAME: ipfs/go-ipfs
18 + IMAGE_NAME: ipfs/kubo
19 + LEGACY_IMAGE_NAME: ipfs/go-ipfs
20 steps:
21 - name: Check out the repo
22 uses: actions/checkout@v2
Dockerfile
+2 -2
@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \
8 ca-certificates \
9 fuse
10
11 -ENV SRC_DIR /go-ipfs
11 +ENV SRC_DIR /kubo
12
13 # Download packages first so they can be cached.
14 COPY go.mod go.sum $SRC_DIR/
@@ -51,7 +51,7 @@ FROM busybox:1.31.1-glibc
51 LABEL maintainer="Steven Allen <steven@stebalien.com>"
52
53 # Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
54 -ENV SRC_DIR /go-ipfs
54 +ENV SRC_DIR /kubo
55 COPY --from=0 $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
56 COPY --from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
57 COPY --from=0 $SRC_DIR/bin/container_init_run /usr/local/bin/container_init_run
README.md
+5 -2
@@ -105,9 +105,12 @@ If your system is resource-constrained, we recommend:
105
106 ### Docker
107
108 -[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/ipfs/go-ipfs?color=blue&label=go-ipfs%20docker%20image&logo=docker&sort=semver&style=flat-square&cacheSeconds=3600)](https://hub.docker.com/r/ipfs/go-ipfs/)
108 +[![Docker Image Version (legacy name)](https://img.shields.io/docker/v/ipfs/go-ipfs?color=blue&label=go-ipfs%20docker%20image&logo=docker&sort=semver&style=flat-square&cacheSeconds=3600)](https://hub.docker.com/r/ipfs/go-ipfs/)
109 +<!-- TODO: replace with kubo after we have minimum set of images after kubo 0.14 (stable semver release, 'latest' and 'release' docker tags)
110 +[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/ipfs/kubo?color=blue&label=kubo%20docker%20image&logo=docker&sort=semver&style=flat-square&cacheSeconds=3600)](https://hub.docker.com/r/ipfs/kubo/)
111 +-->
112
110 -More info on how to run kubo inside docker can be found [here](https://docs.ipfs.io/how-to/run-ipfs-inside-docker/).
113 +More info on how to run kubo (go-ipfs) inside Docker can be found [here](https://docs.ipfs.io/how-to/run-ipfs-inside-docker/).
114
115 ### Native Linux package managers
116
bin/get-docker-tags.sh
+4 -2
@@ -29,13 +29,15 @@ BUILD_NUM=$1
29 GIT_SHA1=${2:-$(git rev-parse HEAD)}
30 GIT_SHA1_SHORT=$(echo "$GIT_SHA1" | cut -c 1-7)
31 GIT_BRANCH=${3:-$(git symbolic-ref -q --short HEAD || echo "unknown")}
32 -GIT_TAG=${4:-$(git describe --tags --exact-match || echo "")}
32 +GIT_TAG=${4:-$(git describe --tags --exact-match 2> /dev/null || echo "")}
33
34 -IMAGE_NAME=${IMAGE_NAME:-ipfs/go-ipfs}
34 +IMAGE_NAME=${IMAGE_NAME:-ipfs/kubo}
35 +LEGACY_IMAGE_NAME=${LEGACY_IMAGE_NAME:-ipfs/go-ipfs}
36
37 echoImageName () {
38 local IMAGE_TAG=$1
39 echo "$IMAGE_NAME:$IMAGE_TAG"
40 + echo "$LEGACY_IMAGE_NAME:$IMAGE_TAG"
41 }
42
43 if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then