Skip to content

Commit

Permalink
chore: initial container setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Oct 17, 2024
1 parent e658a7f commit d265dc4
Show file tree
Hide file tree
Showing 7 changed files with 818 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: weekly
33 changes: 33 additions & 0 deletions .github/workflows/ci-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Image CI
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- "*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: false
build-args: |
VERSION=latest
52 changes: 52 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Image CI
on:
push:
tags:
- "*"
concurrency:
group: "docker-image"
cancel-in-progress: true
env:
DOCKER_BUILDKIT: "1"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate repository name
run: |
echo "REPOSITORY_PATH=$( echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]' )" >> ${GITHUB_ENV}
echo "REPOSITORY_SHA=$( echo ${GITHUB_SHA} | cut -c 1-7 )" >> ${GITHUB_ENV}
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
build-args: |
VERSION=${{ github.ref_name }}
tags: |
ghcr.io/${{ env.REPOSITORY_PATH }}:v${{ github.ref_name }}
ghcr.io/${{ env.REPOSITORY_PATH }}:${{ env.REPOSITORY_SHA }}
ghcr.io/${{ env.REPOSITORY_PATH }}:latest
- name: GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
tag_name: ${{ github.ref_name }}
release_name: v${{ github.ref_name }}
body_path: CHANGELOG.md
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1.0.0 (2024-10-17)

* initial build
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Stage 1: Risc0 Development Container
FROM ghcr.io/anagrambuild/solana:latest
ARG TARGETARCH

# Install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
binutils \
clang \
cmake \
gnupg2 \
libssl-dev \
make \
ninja-build \
perl \
pkg-config \
protobuf-c-compiler \
&& \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV USER=solana
ARG SOLANA=1.18.22
ENV CARGO_HOME=/usr/local/cargo
ENV RUSTUP_HOME=/usr/local/rustup
ENV PATH=${PATH}:/usr/local/cargo/bin:/go/bin:/home/solana/.local/share/solana/install/releases/${SOLANA}/bin

RUN cargo install cargo-binstall
RUN yes | cargo binstall cargo-risczero
RUN cargo risczero build-toolchain

LABEL \
org.label-schema.name="risc0" \
org.label-schema.description="Risc0 Development Container" \
org.label-schema.url="https://github.com/anagrambuild/risc0" \
org.label-schema.vcs-url="[email protected]/anagrambuild/risc0.git" \
org.label-schema.vendor="anagram.xyz" \
org.label-schema.schema-version="1.0" \
org.opencontainers.image.description="Risc0 Development Container"
Loading

0 comments on commit d265dc4

Please sign in to comment.