Skip to content

Commit

Permalink
Minor Docker enhancements
Browse files Browse the repository at this point in the history
# Description

This PR:
- Sets some additional RFC standard LABELS to our Docker container
- Upload the container to both GitHub and DockerHub registries (PRs do not upload to DH)
- Minor Dockerfile efficiencies.

It's a follow up from #1656
  • Loading branch information
gpmayorga committed Dec 26, 2023
1 parent 12ec00a commit 48d6810
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 50 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:
pull_request:
paths:
- ".github/workflows/build-docker.yml"
- "docker/"
- "docker/centrifuge-chain"
- "docker/scripts"
- ".dockerignore"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}${{ github.event_name }}
Expand All @@ -33,11 +34,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3

# - name: DockerHub Registry Login
# uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: DockerHub Registry Login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Github Registry login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
Expand All @@ -61,6 +62,12 @@ jobs:
type=ref,event=tag,suffix=-{{sha}}-${{ env.NOW }},prefix=${{ matrix.target == 'test' && 'test-' || '' }}
type=ref,event=pr,suffix=-{{sha}}-${{ env.NOW }},prefix=${{ matrix.target == 'test' && 'test-' || '' }}PR
type=ref,event=branch,prefix=${{ matrix.target == 'test' && 'test-' || '' }},suffix=-{{sha}}-${{ env.NOW }}
labels: |
org.opencontainers.image.vendor="K/F Labs" \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.documentation="https://github.com/centrifuge/centrifuge-chain/blob/main/README.md" \
org.opencontainers.image.base.name="ubuntu/jammy" \
org.opencontainers.image.base.digest="ubuntu@sha256:6042500cf4b44023ea1894effe7890666b0c5c7871ed83a97c36c76ae560bb9b"
- name: Configure GHA cache
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v6
Expand Down
19 changes: 2 additions & 17 deletions docker/centrifuge-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@ FROM --platform=linux/amd64 docker.io/paritytech/ci-linux:production as builder
FROM --platform=linux/amd64 docker.io/library/ubuntu:jammy
ARG BUILD_DATE
ARG VERSION
# Standard OCI labels
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL io.centrifuge.image.vendor="Centrifuge" \
org.opencontainers.image.created= \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.title="centrifugeio/centrifuge-chain" \
org.opencontainers.image.description="Centrifuge, the layer 1 of RWA. This is the official Centrifuge (para)chain image" \
org.opencontainers.image.source="https://github.com/centrifuge/centrifuge-chain/" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.documentation="https://github.com/centrifuge/centrifuge-chain/blob/main/README.md" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.licenses="GPL-3" \
org.opencontainers.image.base.name="ubuntu/jammy" \
org.opencontainers.image.base.digest="ubuntu@sha256:6042500cf4b44023ea1894effe7890666b0c5c7871ed83a97c36c76ae560bb9b"
# org.opencontainers.image.url= \



RUN apt-get update && apt-get install -y curl jq
RUN apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
Expand All @@ -57,6 +40,8 @@ FROM --platform=linux/amd64 docker.io/library/ubuntu:jammy
COPY --from=builder /centrifuge-chain/target/release/centrifuge-chain /usr/local/bin/

COPY docker/scripts /centrifuge/scripts
# The following will make everything under /centrifuge/scripts reachable from PATH
# by creating a symbolic link into /usr/local/bin
RUN chmod +x /centrifuge/scripts/* && \
ln -s /centrifuge/scripts/* /usr/local/bin/

Expand Down
27 changes: 0 additions & 27 deletions docker/scripts/check-node-ready

This file was deleted.

0 comments on commit 48d6810

Please sign in to comment.