Skip to content

Commit

Permalink
ci: add docker image description publishing (#1234)
Browse files Browse the repository at this point in the history
* Add Docker image description publishing

* Fix ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Test ci

* Fix ci
  • Loading branch information
sergejparity committed Feb 21, 2023
1 parent 14b05f8 commit c97972a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ build:
buildah push --format=v2s2 "$CONTAINER_REPO:$DOCKER_IMAGE_TAG";
fi

push-docker-image-description:
stage: build
before_script:
- echo
extends:
- .kubernetes-env
variables:
CI_IMAGE: paritytech/dockerhub-description
DOCKERHUB_REPOSITORY: parity/substrate-api-sidecar
DOCKER_USERNAME: $Docker_Hub_User_Parity
DOCKER_PASSWORD: $Docker_Hub_Pass_Parity
README_FILEPATH: $CI_PROJECT_DIR/Dockerfile.README.md
SHORT_DESCRIPTION: "REST service to interact with blockchain nodes built using Substrate's FRAME framework."
rules:
- if: $CI_COMMIT_REF_NAME == "master"
changes:
- Dockerfile.README.md
script:
- cd / && sh entrypoint.sh

# checks that dockerimage can be built without publishing
build-pr:
<<: *dockerize
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile.README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## substrate-api-sidecar Docker Image

With each release, the maintainers publish a docker image to dockerhub at [parity/substrate-api-sidecar](https://hub.docker.com/r/parity/substrate-api-sidecar/tags?page=1&ordering=last_updated)

### Pull the latest release

```bash
docker pull docker.io/parity/substrate-api-sidecar:latest
```

The specific image tag matches the release version.

### Or build from source

```bash
yarn build:docker
```

### Run

```bash
# For default use run:
docker run --rm -it --read-only -p 8080:8080 substrate-api-sidecar

# Or if you want to use environment variables set in `.env.docker`, run:
docker run --rm -it --read-only --env-file .env.docker -p 8080:8080 substrate-api-sidecar
```

**NOTE**: While you could omit the `--read-only` flag, it is **strongly recommended for containers used in production**.

then you can test with:

```bash
curl -s http://0.0.0.0:8080/blocks/head | jq
```

**N.B.** The docker flow presented here is just a sample to help get started. Modifications may be necessary for secure usage.

0 comments on commit c97972a

Please sign in to comment.