Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support codenotary verify/signing #73

Merged
merged 7 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignored:
- DL3003
- DL3006
- DL3008
- DL3018
70 changes: 40 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
ARG BUILD_FROM
FROM $BUILD_FROM

# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Setup locals
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
git \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/* \
ENV LANG C.UTF-8

# Install docker
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gpg-agent \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io \
&& rm -rf /var/lib/apt/lists/*
ENV \
VCN_OTP_EMPTY=true \
LANG=C.UTF-8

# Setup arm binary support
ARG BUILD_ARCH
RUN if [ "$BUILD_ARCH" != "amd64" ]; then exit 0; else \
apt-get update && apt-get install -y --no-install-recommends \
qemu-user-static \
binfmt-support \
&& rm -rf /var/lib/apt/lists/*; fi
ARG VCN_VERSION

RUN \
set -x \
&& apk add --no-cache \
git \
docker \
&& apk add --no-cache --virtual .build-dependencies \
build-base \
go \
\
&& git clone -b v${VCN_VERSION} --depth 1 \
https://github.com/codenotary/vcn \
&& cd vcn \
\
# Fix: https://github.com/codenotary/vcn/issues/131
pvizeli marked this conversation as resolved.
Show resolved Hide resolved
&& go get github.com/codenotary/immudb@4cf9e2ae06ac2e6ec98a60364c3de3eab5524757 \
pvizeli marked this conversation as resolved.
Show resolved Hide resolved
\
&& if [ "${BUILD_ARCH}" = "armhf" ]; then \
GOARM=6 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then \
GOARM=7 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
GOARCH=arm64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
GOARCH=386 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
GOARCH=amd64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
else \
exit 1; \
fi \
\
&& rm -rf /root/go /root/.cache \
&& mv vcn /usr/bin/vcn \
\
&& apk del .build-dependencies \
&& rm -rf /usr/src/vcn

COPY builder.sh /usr/bin/

Expand Down
11 changes: 8 additions & 3 deletions build.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"image": "homeassistant/{arch}-builder",
"build_from": {
"aarch64": "homeassistant/aarch64-base-ubuntu:18.04",
"armv7": "homeassistant/armv7-base-ubuntu:18.04",
"amd64": "homeassistant/amd64-base-ubuntu:18.04"
"aarch64": "homeassistant/aarch64-base:3.13",
"armv7": "homeassistant/armv7-base:3.13",
"armhf": "homeassistant/armhf-base:3.13",
"amd64": "homeassistant/amd64-base:3.13",
"i386": "homeassistant/i386-base:3.13"
},
"args": {
"VCN_VERSION": "0.9.4"
},
"labels": {
"io.hass.type": "builder"
Expand Down
Loading