Skip to content

Commit

Permalink
containers
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Oct 27, 2024
1 parent b761bb7 commit 7ace5dc
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: containers

on:
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: tezwatch container
uses: docker/build-push-action@v4
with:
file: ./containers/tezos/Containerfile
platforms: linux/amd64
build-args: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ARCH=x64
tags: ghcr.io/tez-capital/tezos:latest
push: true
provenance: false

- name: tezwatch container
uses: docker/build-push-action@v4
with:
file: ./containers/tezos/Containerfile
platforms: linux/arm64
build-args: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ARCH=arm64
tags: ghcr.io/tez-capital/tezos:latest
push: true
provenance: false
33 changes: 33 additions & 0 deletions containers/tezos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM docker.io/ubuntu:jammy

ARG ARCH

ENV TEZOS_USER=tezos \
TEZOS_HOME=/home/tezos \
TEZOS_BIN=/usr/local/bin \
TEZOS_SHARE=/usr/local/share/tezos \
REPO_API=https://api.github.com/repos/tez-capital/tezos/releases/latest

RUN apt-get update && apt-get install -y \
curl jq \
unzip \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -d ${TEZOS_HOME} -s /bin/bash ${TEZOS_USER}

COPY scripts/docker/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

RUN LATEST_TAG=$(curl -s ${REPO_API} | jq -r .tag_name) && \
DOWNLOAD_URL="https://github.com/tez-capital/tezos/releases/download/${LATEST_TAG}/octez-all-${ARCH}.zip" && \
echo "Downloading ${DOWNLOAD_URL}" && \
curl -L -o octez.zip ${DOWNLOAD_URL} && \
unzip octez.zip -d ${TEZOS_BIN} && \
rm octez.zip

USER ${TEZOS_USER}
WORKDIR ${TEZOS_HOME}

COPY ./scripts/ ${TEZOS_SHARE}/

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

0 comments on commit 7ace5dc

Please sign in to comment.