-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d42feb0
commit 341a804
Showing
1,062 changed files
with
12,857 additions
and
6,781 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ changelog: | |
- title: Other | ||
labels: | ||
- "*" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: container | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- rel/* | ||
- feature/* | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate Container Metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
docker.io/${{ github.repository_owner }}/algod | ||
tags: | | ||
type=sha,format=long,prefix= | ||
type=ref,event=tag | ||
type=ref,event=branch | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'rel/stable') }} | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and Push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
SHA=${{ github.sha }} | ||
URL=${{ github.server_url }}/${{ github.repository }}.git | ||
BRANCH=${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,66 @@ | ||
ARG GO_VERSION=1.17.5 | ||
FROM golang:$GO_VERSION-bullseye as builder | ||
FROM ubuntu:18.04 as builder | ||
|
||
ARG CHANNEL=nightly | ||
ARG URL= | ||
ARG BRANCH= | ||
ARG SHA= | ||
ARG GO_VERSION="1.17.13" | ||
|
||
ARG CHANNEL | ||
ARG URL | ||
ARG BRANCH | ||
ARG SHA | ||
ARG TARGETARCH | ||
|
||
ADD https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz /go.tar.gz | ||
|
||
# Basic dependencies. | ||
ENV HOME /node | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV HOME="/node" DEBIAN_FRONTEND="noninteractive" GOPATH="/dist" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
apt-utils \ | ||
bsdmainutils \ | ||
curl \ | ||
git \ | ||
git-core \ | ||
python3 | ||
&& rm -rf /var/lib/apt/lists/* && \ | ||
\ | ||
tar -C /usr/local -xzf /go.tar.gz && \ | ||
rm -rf /go.tar.gz | ||
|
||
COPY ./docker/files/ /node/files | ||
COPY ./installer/genesis /node/files/run/genesis | ||
COPY ./cmd/updater/update.sh /node/files/build/update.sh | ||
COPY ./installer/config.json.example /node/files/build/config.json | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
||
RUN find /node/files | ||
COPY ./docker/files/ /dist/files | ||
COPY ./installer/genesis /dist/files/run/genesis | ||
COPY ./cmd/updater/update.sh /dist/files/build/update.sh | ||
COPY ./installer/config.json.example /dist/files/run/config.json.example | ||
|
||
# Install algod binaries. | ||
RUN /node/files/build/install.sh \ | ||
-p "/node/bin" \ | ||
-d "/node/data" \ | ||
RUN /dist/files/build/install.sh \ | ||
-p "${GOPATH}/bin" \ | ||
-d "/algod/data" \ | ||
-c "${CHANNEL}" \ | ||
-u "${URL}" \ | ||
-b "${BRANCH}" \ | ||
-s "${SHA}" | ||
|
||
# Copy binaries into a clean image | ||
# TODO: We don't need most of the binaries. | ||
# Should we delete everything except goal/algod/algocfg/tealdbg? | ||
FROM debian:bullseye-slim as final | ||
COPY --from=builder "/node/bin/" "/node/bin" | ||
COPY --from=builder "/node/data/" "/node/dataTemplate" | ||
COPY --from=builder "/node/files/run" "/node/run" | ||
|
||
ENV BIN_DIR="/node/bin" | ||
ENV PATH="$BIN_DIR:${PATH}" | ||
ENV ALGOD_PORT=8080 | ||
ENV ALGORAND_DATA="/algod/data" | ||
RUN mkdir -p "$ALGORAND_DATA" | ||
WORKDIR /node/data | ||
ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" ALGORAND_DATA="/algod/data" | ||
|
||
# curl is needed to lookup the fast catchup url | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
mkdir -p "$ALGORAND_DATA" && \ | ||
groupadd --system algorand && \ | ||
useradd --no-log-init --create-home --system --gid algorand algorand && \ | ||
chown -R algorand:algorand /algod | ||
|
||
# TODO: This works fine, but causes problems when mounting a volume | ||
# Use algorand user instead of root | ||
#RUN groupadd -r algorand && \ | ||
# useradd --no-log-init -r -g algorand algorand && \ | ||
# chown -R algorand.algorand /node && \ | ||
# chown -R algorand.algorand /algod | ||
#USER algorand | ||
USER algorand | ||
|
||
# Algod REST API | ||
EXPOSE $ALGOD_PORT | ||
COPY --chown=algorand:algorand --from=builder "/dist/bin/" "/node/bin/" | ||
COPY --chown=algorand:algorand --from=builder "/dist/files/run/" "/node/run/" | ||
|
||
# Algod Gossip Port | ||
EXPOSE 4160 | ||
# Expose Algod REST API, Algod Gossip, and Prometheus Metrics ports | ||
EXPOSE $ALGOD_PORT 4160 9100 | ||
|
||
# Prometheus Metrics | ||
EXPOSE 9100 | ||
WORKDIR /algod | ||
|
||
CMD ["/node/run/run.sh"] | ||
#CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.