Skip to content

Commit

Permalink
✨ Upgrade aws s3 v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Jun 9, 2024
1 parent 41b49e9 commit 50e221f
Show file tree
Hide file tree
Showing 10 changed files with 1,248 additions and 581 deletions.
11 changes: 6 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.22.2-alpine3.19
ARG GOLANG_VERSION=1.22.4-alpine3.19
ARG NODE_VERSION=20-alpine3.19
ARG ALPINE_VERSION=3.19

Expand All @@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/web/node_modules set -eux && corepack enable && y

FROM alpine:${ALPINE_VERSION} as syft

ARG SYFT_VERSION=1.0.1
ARG SYFT_VERSION=1.5.0
ARG TARGETOS TARGETARCH
ARG USE_MIRROR=false

Expand All @@ -34,7 +34,7 @@ FROM alpine:${ALPINE_VERSION} as trivy

ARG USE_MIRROR=false
ARG WITH_TRIVY_DB=false
ARG TRIVY_VERSION=0.50.4
ARG TRIVY_VERSION=0.52.0
ARG TARGETOS TARGETARCH

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
Expand Down Expand Up @@ -75,8 +75,9 @@ ARG USE_MIRROR=false

RUN set -eux && \
if [ "$USE_MIRROR" = true ]; then sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories; fi && \
apk add --no-cache make bash ncurses build-base git openssl linux-headers && \
apk add --no-cache zig --repository=https://mirrors.aliyun.com/alpine/edge/community
apk add --no-cache make bash ncurses build-base git openssl linux-headers
# && \
# apk add --no-cache zig --repository=https://mirrors.aliyun.com/alpine/edge/community

COPY . /go/src/github.com/go-sigma/sigma
COPY --from=web-builder /web/dist /go/src/github.com/go-sigma/sigma/web/dist
Expand Down
25 changes: 13 additions & 12 deletions build/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG GOLANG_VERSION=1.22.2-alpine3.19
ARG GOLANG_VERSION=1.22.4-alpine3.19
ARG BUILDKIT_VERSION=v0.13.2-rootless
ARG ALPINE_VERSION=3.19

FROM alpine:${ALPINE_VERSION} as cosign

ARG USE_MIRROR=false
ARG COSIGN_VERSION=v2.2.2
ARG COSIGN_VERSION=v2.2.4
ARG TARGETOS TARGETARCH

RUN set -eux && \
Expand All @@ -20,23 +20,24 @@ ARG USE_MIRROR=false

RUN set -eux && \
if [ "$USE_MIRROR" = true ]; then sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories; fi && \
apk add --no-cache make bash ncurses build-base git openssl && \
apk add --no-cache zig --repository=https://mirrors.aliyun.com/alpine/edge/community
apk add --no-cache make bash ncurses build-base git openssl
# && \
# apk add --no-cache zig --repository=https://mirrors.aliyun.com/alpine/edge/community

COPY . /go/src/github.com/go-sigma/sigma
WORKDIR /go/src/github.com/go-sigma/sigma

ARG TARGETOS TARGETARCH

RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
case "${TARGETARCH}" in \
amd64) export CC="zig cc -target x86_64-linux-musl" ;; \
arm64) export CC="zig cc -target aarch64-linux-musl" ;; \
esac; \
case "${TARGETARCH}" in \
amd64) export CXX="zig c++ -target x86_64-linux-musl" ;; \
arm64) export CXX="zig c++ -target aarch64-linux-musl" ;; \
esac; \
# case "${TARGETARCH}" in \
# amd64) export CC="zig cc -target x86_64-linux-musl" ;; \
# arm64) export CC="zig cc -target aarch64-linux-musl" ;; \
# esac; \
# case "${TARGETARCH}" in \
# amd64) export CXX="zig c++ -target x86_64-linux-musl" ;; \
# arm64) export CXX="zig c++ -target aarch64-linux-musl" ;; \
# esac; \
GOOS=$TARGETOS GOARCH=$TARGETARCH CC="${CC}" CXX="${CXX}" make build-builder

FROM moby/buildkit:${BUILDKIT_VERSION}
Expand Down
27 changes: 14 additions & 13 deletions build/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.22.2-bookworm
ARG GOLANG_VERSION=1.22.4-bookworm
ARG NODE_VERSION=20-alpine3.19
ARG ALPINE_VERSION=3.19
ARG DEBIAN_VERSION=bookworm-slim
Expand All @@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/web/node_modules set -eux && corepack enable && y
FROM alpine:${ALPINE_VERSION} as syft

ARG USE_MIRROR=false
ARG SYFT_VERSION=1.0.1
ARG SYFT_VERSION=1.5.0
ARG TARGETOS TARGETARCH

RUN set -eux && \
Expand All @@ -35,7 +35,7 @@ FROM alpine:${ALPINE_VERSION} as trivy

ARG USE_MIRROR=false
ARG WITH_TRIVY_DB=false
ARG TRIVY_VERSION=0.50.4
ARG TRIVY_VERSION=0.52.0
ARG TARGETOS TARGETARCH

RUN set -eux && \
Expand Down Expand Up @@ -89,16 +89,17 @@ RUN set -eux && \
wget \
xz-utils \
&& \
rm -rf /var/lib/apt/lists/* && \
case "${BUILDARCH}" in \
amd64) export ZIGARCH='x86_64' ;; \
arm64) export ZIGARCH='aarch64' ;; \
esac; \
wget -O zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz https://ziglang.org/download/"${ZIG_VERSION}"/zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz && \
tar xf zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz && \
mv ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}"/zig /usr/local/bin && \
mv ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}"/lib /usr/local/bin && \
rm -rf ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}" zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz
rm -rf /var/lib/apt/lists/*
# && \
# case "${BUILDARCH}" in \
# amd64) export ZIGARCH='x86_64' ;; \
# arm64) export ZIGARCH='aarch64' ;; \
# esac; \
# wget -O zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz https://ziglang.org/download/"${ZIG_VERSION}"/zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz && \
# tar xf zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz && \
# mv ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}"/zig /usr/local/bin && \
# mv ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}"/lib /usr/local/bin && \
# rm -rf ./zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}" zig-linux-"${ZIGARCH}"-"${ZIG_VERSION}".tar.xz

COPY . /go/src/github.com/go-sigma/sigma
COPY --from=web-builder /web/dist /go/src/github.com/go-sigma/sigma/web/dist
Expand Down
Loading

0 comments on commit 50e221f

Please sign in to comment.