Skip to content

Commit e7f4eec

Browse files
committed
ci: Fix the Dockerfile and build from CI
Fix the Dockerfile and add the Docker build to the CI. The docker build error was: ``` 1.359 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found 1.359 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found 1.359 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found 1.359 E: Some index files failed to download. They have been ignored, or old ones used instead. ``` Also use a minimal image for the final build stage. New image size is 240MB vs 4.4G for the old one. In a follow up PR we could add multi-arch build support and automatic image upload to Docker registries.
1 parent 12a18d7 commit e7f4eec

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.github/workflows/docker.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Docker Build
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: docker/setup-buildx-action@v3
12+
- run: docker build --tag=canto-network/canto .
13+
- run: docker run -it --volume --rm canto-network/canto

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
FROM golang:stretch AS build-env
1+
FROM golang:1.21 AS build-env
22

33
WORKDIR /go/src/github.com/canto/canto
44

5-
RUN apt-get update -y
6-
RUN apt-get install git -y
7-
85
COPY . .
96

107
RUN make build
118

12-
FROM golang:stretch
13-
14-
RUN apt-get update -y
15-
RUN apt-get install ca-certificates jq -y
9+
FROM debian:12-slim
1610

1711
WORKDIR /root
1812

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Becoming A Validator
22

3+
[![Build Canto Core](https://github.com/Canto-Network/Canto/actions/workflows/build.yml/badge.svg)](https://github.com/Canto-Network/Canto/actions/workflows/build.yml)
4+
[![Docker Build](https://github.com/Canto-Network/Canto/actions/workflows/docker.yml/badge.svg)](https://github.com/Canto-Network/Canto/actions/workflows/docker.yml)
5+
[![Sims](https://github.com/Canto-Network/Canto/actions/workflows/sims.yml/badge.svg)](https://github.com/Canto-Network/Canto/actions/workflows/sims.yml)
6+
[![Tests / Code Coverage](https://github.com/Canto-Network/Canto/actions/workflows/test.yml/badge.svg)](https://github.com/Canto-Network/Canto/actions/workflows/test.yml)
7+
38
**How to validate on the Canto Mainnet**
49

510
*(canto_7700-1)*

0 commit comments

Comments
 (0)