Skip to content

Commit b6e74f8

Browse files
authored
Merge pull request #903 - Oneliner v1.5.0
oneliner: Release v1.5.0 Created with Sturdy Merged via Sturdy
2 parents e579a4e + e6fc3f6 commit b6e74f8

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Dockerfile

+12-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
1616
go build -v -o /usr/bin/ssh getsturdy.com/ssh/cmd/ssh
1717

1818
FROM debian:11.2-slim as ssh
19-
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
RUN apt-get update && apt-get install -y --no-install-recommends --allow-downgrades \
2020
ca-certificates \
2121
&& rm -rf /var/lib/apt/lists/*
2222
COPY --from=ssh-builder /usr/bin/ssh /usr/bin/ssh
@@ -28,7 +28,7 @@ COPY --from=ssh-builder /go/src/ssh/mutagen-agent-v0.13.0-beta2 /usr/bin/mutagen
2828
FROM golang:1.18.0-bullseye as api-builder
2929
# compile libgit2
3030
RUN apt-get update \
31-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
31+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --allow-downgrades \
3232
libgit2-dev \
3333
libssh2-1-dev \
3434
git=1:2.30.2-1 \
@@ -61,7 +61,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build,id=go-build \
6161

6262
FROM debian:11.2-slim as api
6363
RUN apt-get update \
64-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
64+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --allow-downgrades \
6565
git-lfs=2.13.2-1+b5 \
6666
ca-certificates \
6767
&& rm -rf /var/lib/apt/lists/*
@@ -78,14 +78,16 @@ ENV PKG_CONFIG_ALLOW_CROSS="1" \
7878
DEBIAN_FRONTEND="noninteractive" \
7979
CARGO_BUILD_TARGET="aarch64-unknown-linux-gnu"
8080
RUN apt-get update \
81-
&& apt-get -y --no-install-recommends install \
81+
&& apt-get -y --no-install-recommends --allow-downgrades install \
8282
musl-tools \
8383
ca-certificates \
8484
git \
8585
&& git clone https://github.com/jasonwhite/rudolfs
8686
WORKDIR /rudolfs
8787
SHELL ["/bin/bash", "-c"]
88-
RUN git checkout 0.3.5 \
88+
RUN --mount=type=cache,target=/usr/local/cargo/registry \
89+
--mount=type=cache,target=/rudolfs/target \
90+
git checkout 0.3.5 \
8991
&& rustup target add "${CARGO_BUILD_TARGET}" \
9092
&& cargo build --target "${CARGO_BUILD_TARGET}" --release \
9193
&& mkdir -p /build \
@@ -95,7 +97,7 @@ RUN git checkout 0.3.5 \
9597
FROM debian:11.2-slim as rudolfs
9698
VOLUME ["/data"]
9799
RUN apt-get update \
98-
&& apt-get install -y --no-install-recommends \
100+
&& apt-get install -y --no-install-recommends --allow-downgrades \
99101
ca-certificates
100102
# use the correct binary depending on the architecture. we do this to avoid building amd64 version ourselves,
101103
# as it requires us to run qemu emulation which is very slow.
@@ -120,7 +122,7 @@ RUN apk update \
120122
COPY ./web/package.json ./package.json
121123
COPY ./web/yarn.lock ./yarn.lock
122124
# The --network-timeout is here to prevent network issues when building linux/amd64 images on linux/arm64 hosts
123-
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn \
125+
RUN --mount=type=cache,target=/root/.yarn,id=web-installer-3 YARN_CACHE_FOLDER=/root/.yarn \
124126
yarn install --frozen-lockfile \
125127
--network-timeout 1000000000
126128
# build web
@@ -158,7 +160,7 @@ FROM debian:11.2-slim as oneliner
158160
# ca-cerificates is needed by ssh to connect to tls hosts
159161
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
160162
RUN apt-get update \
161-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
163+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --allow-downgrades \
162164
curl=7.74.0-1.3+deb11u1 \
163165
ca-certificates=20210119 \
164166
gnupg=2.2.27-2 \
@@ -167,9 +169,9 @@ RUN apt-get update \
167169
| tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null \
168170
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/postgresql.list \
169171
&& apt-get update \
170-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
172+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --allow-downgrades \
171173
postgresql-14=14.2-1.pgdg110+1 \
172-
openssl=1.1.1k-1+deb11u1 \
174+
openssl=1.1.1k-1+deb11u2 \
173175
git=1:2.30.2-1 \
174176
git-lfs=2.13.2-1+b5 \
175177
keychain=2.8.5-2 \

scripts/build-upload-oneliner.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IMAGE="getsturdy/server"
1414
VERSION=$(date +%Y-%m-%d-%H-%M-%S)
1515
DOCKER_VERSION_TAG_ARG=""
1616
PUSH_ARG=""
17-
LATEST_VERSION="$(curl -s https://registry.hub.docker.com/v1/repositories/getsturdy/server/tags | jq -r '.[].name' | tail -1)"
17+
LATEST_VERSION="$(curl -s https://registry.hub.docker.com/v1/repositories/getsturdy/server/tags | jq -r '.[].name' | grep -v cache | tail -1)"
1818
VERSION=""
1919

2020
while [[ $# -gt 0 ]]; do
@@ -75,6 +75,8 @@ echo
7575
docker buildx build \
7676
--platform linux/arm64,linux/amd64 \
7777
--target oneliner \
78+
--cache-to=getsturdy/server:cache \
79+
--cache-from=getsturdy/server:cache \
7880
--build-arg API_BUILD_TAGS=enterprise \
7981
--build-arg VERSION="${VERSION}" \
8082
--tag "${IMAGE}:latest" \

scripts/run-oneliner.sh

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66

77
docker buildx build --load \
88
--target oneliner \
9+
--cache-from=getsturdy/server:cache \
910
--build-arg API_BUILD_TAGS=enterprise \
1011
--build-arg VERSION="development" \
1112
--tag "sturdy-oneliner:oss" \

0 commit comments

Comments
 (0)