-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make docker image easier to reproduce
- Loading branch information
Showing
9 changed files
with
175 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build --no-cache -f Dockerfile.ubuntu . |
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,7 @@ | ||
#!/bin/bash | ||
|
||
docker build --pull --no-cache -t shiftcrypto/firmware_v2 . | ||
docker pull shiftcrypto/firmware_v2:41 | ||
|
||
# Print out the differences but ignore them. We don't require reproducible builds right now. | ||
ocidiff shiftcrypto/firmware_v2:latest shiftcrypto/firmware_v2:41 || true |
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,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CONTAINER_REPO=shiftcrypto/firmware_v2 | ||
CONTAINER_VERSION=$(grep ^CONTAINER_VERSION Makefile | cut -d ' ' -f3) | ||
|
||
if docker manifest inspect $CONTAINER_REPO:$CONTAINER_VERSION; then | ||
echo $CONTAINER_VERSION already exists, will not publish | ||
exit 1 | ||
fi | ||
|
||
docker build --no-cache -t $CONTAINER_REPO:latest -t $CONTAINER_REPO:$CONTAINER_VERSION . | ||
docker push $CONTAINER_REPO:latest $CONTAINER_REPO:$CONTAINER_VERSION |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Container nightly check | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
env: | ||
DIFFOCI_URL: https://github.com/reproducible-containers/diffoci/releases/download/v0.1.4/diffoci-v0.1.4.linux-amd64 | ||
|
||
jobs: | ||
check-base-image: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Fetch diffoci | ||
run: curl -L $DIFFOCI_URL -o /usr/local/bin/diffoci | ||
- name: Check that base container builds | ||
run: ./.ci/build-base-container | ||
|
||
check-dev-image: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Fetch diffoci | ||
run: curl -L $DIFFOCI_URL -o /usr/local/bin/diffoci | ||
- name: Check that dev container builds | ||
run: ./.ci/build-dev-container |
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,14 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- Dockerfile | ||
jobs: | ||
check-base-image: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish new container version | ||
run: ./.ci/publish-container |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright 2019 Shift Cryptosecurity AG | ||
# Copyright 2020 Shift Crypto AG | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Latest Ubuntu LTS | ||
FROM ubuntu:22.04@sha256:0eb0f877e1c869a300c442c41120e778db7161419244ee5cbc6fa5f134e74736 | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ | ||
wget \ | ||
curl \ | ||
gnupg2 \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
# for clang-*-18, see https://apt.llvm.org/ | ||
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \ | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ | ||
rm /root/.wget-hsts | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ | ||
make \ | ||
git \ | ||
pkg-config \ | ||
nano \ | ||
jq \ | ||
unzip \ | ||
python3 \ | ||
python3-pip \ | ||
binutils \ | ||
valgrind \ | ||
cmake \ | ||
autotools-dev \ | ||
automake \ | ||
autoconf \ | ||
libtool \ | ||
libcmocka-dev \ | ||
bzip2 \ | ||
llvm-18 \ | ||
gcc-10 \ | ||
libc6-i386 \ | ||
lib32stdc++6 \ | ||
lib32z1 \ | ||
libusb-1.0-0-dev \ | ||
libudev-dev \ | ||
libhidapi-dev \ | ||
doxygen \ | ||
graphviz \ | ||
clang-format-18 \ | ||
clang-tidy-18 \ | ||
bash-completion \ | ||
&& rm -r /var/lib/apt/lists/* |
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