Skip to content

Commit a725303

Browse files
committed
Force Dockerfile to use https
1 parent 0e373ee commit a725303

File tree

2 files changed

+80
-4
lines changed

2 files changed

+80
-4
lines changed

.github/workflows/debug.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
on:
3+
push:
4+
branch: [135-fix-github-action-workflow]
5+
6+
env:
7+
ECR_REPOSITORY_URL: docker.io
8+
ECR_REPOSITORY_NAME: minafoundation/mina-mesh
9+
10+
jobs:
11+
publish:
12+
runs-on: minafoundation-default-runners
13+
steps:
14+
- name: 📥 Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: 🦀 Setup Rust toolchain
18+
uses: dsherret/rust-toolchain-file@v1
19+
20+
- name: 📦 Cache Cargo binaries
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.cargo/bin
24+
key: cargo-bin-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
25+
restore-keys: cargo-bin-${{ runner.os }}-
26+
27+
- name: 🔧 Install cargo-edit if missing
28+
run: |
29+
command -v cargo-set-version &>/dev/null || cargo install cargo-edit
30+
31+
- name: 🏷️ Set Version of the crate
32+
run: |
33+
# echo "VERSION=${GITHUB_REF_NAME#?}" >> $GITHUB_ENV
34+
# cargo set-version $VERSION
35+
echo "VERSION=debug" >> $GITHUB_ENV
36+
37+
# - name: 📦 Publish to crates.io
38+
# if: github.event_name == 'release'
39+
# uses: katyo/publish-crates@v2
40+
# with:
41+
# registry-token: ${{ secrets.CRATES_IO_TOKEN }}
42+
# args: --allow-dirty --no-verify
43+
44+
- name: 🔍 Extract build args from mina.yaml
45+
run: |
46+
for network in mainnet devnet; do
47+
echo "MINA_BASE_TAG_${network^^}=$(yq ".supported_releases.$network.mina_base_tag" mina.yaml)" >> $GITHUB_ENV
48+
echo "DEBIAN_RELEASE_CHANNEL_${network^^}=$(yq ".supported_releases.$network.debian_release_channel" mina.yaml)" >> $GITHUB_ENV
49+
done
50+
51+
- name: 🐳 Login to Docker Hub
52+
uses: docker/login-action@v3
53+
with:
54+
username: ${{ secrets.DOCKER_IO_USERNAME }}
55+
password: ${{ secrets.DOCKER_IO_TOKEN }}
56+
57+
- name: 🛠️ Build and 🚀 Push Docker Images
58+
run: |
59+
for network in mainnet devnet; do
60+
MINA_BASE_TAG_VAR="MINA_BASE_TAG_${network^^}"
61+
DEBIAN_RELEASE_CHANNEL_VAR="DEBIAN_RELEASE_CHANNEL_${network^^}"
62+
63+
docker build --build-arg MINA_BASE_TAG=${!MINA_BASE_TAG_VAR} \
64+
--build-arg MINA_NETWORK=$network \
65+
--build-arg DEBIAN_RELEASE_CHANNEL=${!DEBIAN_RELEASE_CHANNEL_VAR} \
66+
--add-host deb.debian.org:146.75.42.13 \
67+
-t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:$network-${{ env.VERSION }} \
68+
-t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:$network-latest \
69+
$( [[ "$network" == "mainnet" ]] && echo "-t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.VERSION }} -t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:latest" ) .
70+
done
71+
72+
docker push --all-tags ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ ENV RUSTUP_HOME=/usr/local/rustup \
88
CARGO_HOME=/usr/local/cargo \
99
PATH=/usr/local/cargo/bin:$PATH
1010

11-
# Install required dependencies and Rust in one step to minimize layers
12-
RUN apt-get update && apt-get install -y \
11+
RUN apt-get update && apt-get install -y ca-certificates apt-transport-https && \
12+
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list && \
13+
apt-get update && apt-get install -y \
1314
curl \
1415
build-essential \
1516
pkg-config \
@@ -48,7 +49,10 @@ ENV PGDATA=/var/lib/postgresql/data
4849
ENV POSTGRES_VERSION=$POSTGRES_VERSION
4950

5051
# Install dependencies and Mina daemon in one step
51-
RUN apt-get update && apt-get install -y \
52+
53+
RUN apt-get update && apt-get install -y ca-certificates apt-transport-https && \
54+
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list && \
55+
apt-get update && apt-get install -y \
5256
curl \
5357
gnupg \
5458
sudo \
@@ -57,7 +61,7 @@ RUN apt-get update && apt-get install -y \
5761
&& echo | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh \
5862
&& apt-get install -y \
5963
postgresql-$POSTGRES_VERSION \
60-
&& echo "deb [trusted=yes] http://packages.o1test.net $(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) ${DEBIAN_RELEASE_CHANNEL}" | tee /etc/apt/sources.list.d/mina.list \
64+
&& echo "deb [trusted=yes] https://packages.o1test.net $(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) ${DEBIAN_RELEASE_CHANNEL}" | tee /etc/apt/sources.list.d/mina.list \
6165
&& echo "Installing mina-${MINA_NETWORK}=${MINA_BASE_TAG}" \
6266
&& apt-get update && \
6367
apt-get install --allow-downgrades -y mina-${MINA_NETWORK}=${MINA_BASE_TAG} mina-archive=${MINA_BASE_TAG} \

0 commit comments

Comments
 (0)