Skip to content

Commit df278cd

Browse files
authored
chore: Clean up docker building (#1877)
Signed-off-by: Igor Šarčević <igor@operately.com>
1 parent 16a368b commit df278cd

File tree

4 files changed

+13
-63
lines changed

4 files changed

+13
-63
lines changed

Dockerfile

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ ARG GO_VERSION=1.25.3
22
ARG UBUNTU_VERSION=22.04
33
ARG BUILDER_IMAGE="ubuntu:${UBUNTU_VERSION}"
44
ARG RUNNER_IMAGE="ubuntu:${UBUNTU_VERSION}"
5-
ARG APT_MIRROR="http://archive.ubuntu.com/ubuntu"
6-
ARG APT_SECURITY_MIRROR="http://security.ubuntu.com/ubuntu"
75

86
# ----------------------------------------------------------------------------------------------------------------------
97
# Base stage with common dependencies.
@@ -15,14 +13,6 @@ FROM ${BUILDER_IMAGE} AS base
1513
WORKDIR /tmp
1614

1715
COPY scripts/docker scripts
18-
ARG APT_MIRROR
19-
ARG APT_SECURITY_MIRROR
20-
RUN if [ -n "${APT_MIRROR}" ]; then \
21-
sed -i "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}|g" /etc/apt/sources.list; \
22-
fi && \
23-
if [ -n "${APT_SECURITY_MIRROR}" ]; then \
24-
sed -i "s|http://security.ubuntu.com/ubuntu|${APT_SECURITY_MIRROR}|g" /etc/apt/sources.list; \
25-
fi
2616

2717
ENV GO_VERSION=1.25.3
2818
ENV PATH="/usr/local/go/bin:${PATH}"
@@ -111,15 +101,6 @@ LABEL org.opencontainers.image.title="superplane" \
111101
org.opencontainers.image.url="https://superplane.com" \
112102
org.opencontainers.image.documentation="https://docs.superplane.com"
113103

114-
ARG APT_MIRROR
115-
ARG APT_SECURITY_MIRROR
116-
RUN if [ -n "${APT_MIRROR}" ]; then \
117-
sed -i "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}|g" /etc/apt/sources.list; \
118-
fi && \
119-
if [ -n "${APT_SECURITY_MIRROR}" ]; then \
120-
sed -i "s|http://security.ubuntu.com/ubuntu|${APT_SECURITY_MIRROR}|g" /etc/apt/sources.list; \
121-
fi
122-
123104
# postgresql-client needs to be installed here too,
124105
# otherwise the createdb command won't work.
125106
# Install PostgreSQL 17.5 client tools

release/superplane-demo-image/Dockerfile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ ARG GO_VERSION=1.25.3
22
ARG UBUNTU_VERSION=22.04
33
ARG BUILDER_IMAGE="ubuntu:${UBUNTU_VERSION}"
44
ARG RUNNER_IMAGE="ubuntu:${UBUNTU_VERSION}"
5-
ARG APT_MIRROR="http://archive.ubuntu.com/ubuntu"
6-
ARG APT_SECURITY_MIRROR="http://security.ubuntu.com/ubuntu"
75

86
# ----------------------------------------------------------------------------------------------------------------------
97
# Base stage with build dependencies (mirrors root Dockerfile's base).
@@ -14,14 +12,6 @@ FROM ${BUILDER_IMAGE} AS base
1412
WORKDIR /tmp
1513

1614
COPY scripts/docker scripts
17-
ARG APT_MIRROR
18-
ARG APT_SECURITY_MIRROR
19-
RUN if [ -n "${APT_MIRROR}" ]; then \
20-
sed -i "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}|g" /etc/apt/sources.list; \
21-
fi && \
22-
if [ -n "${APT_SECURITY_MIRROR}" ]; then \
23-
sed -i "s|http://security.ubuntu.com/ubuntu|${APT_SECURITY_MIRROR}|g" /etc/apt/sources.list; \
24-
fi
2515

2616
ENV GO_VERSION=1.25.3
2717
ENV PATH="/usr/local/go/bin:${PATH}"
@@ -74,14 +64,6 @@ RUN VITE_BASE_URL=$BASE_URL npm run build
7464
FROM ${RUNNER_IMAGE} AS demo
7565

7666
ENV DEBIAN_FRONTEND=noninteractive
77-
ARG APT_MIRROR
78-
ARG APT_SECURITY_MIRROR
79-
RUN if [ -n "${APT_MIRROR}" ]; then \
80-
sed -i "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}|g" /etc/apt/sources.list; \
81-
fi && \
82-
if [ -n "${APT_SECURITY_MIRROR}" ]; then \
83-
sed -i "s|http://security.ubuntu.com/ubuntu|${APT_SECURITY_MIRROR}|g" /etc/apt/sources.list; \
84-
fi
8567

8668
LABEL org.opencontainers.image.title="superplane-demo" \
8769
org.opencontainers.image.description="SuperPlane demo image with embedded PostgreSQL and RabbitMQ for local trials." \

release/superplane-demo-image/build.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@ fi
1515

1616
VERSION="$1"
1717
ARCH="$2"
18-
APT_MIRROR="${APT_MIRROR-}"
19-
APT_SECURITY_MIRROR="${APT_SECURITY_MIRROR-}"
2018

2119
echo "Building SuperPlane demo image"
2220

23-
BUILD_ARGS=()
24-
if [ -n "${APT_MIRROR}" ]; then
25-
BUILD_ARGS+=(--build-arg "APT_MIRROR=${APT_MIRROR}")
26-
fi
27-
if [ -n "${APT_SECURITY_MIRROR}" ]; then
28-
BUILD_ARGS+=(--build-arg "APT_SECURITY_MIRROR=${APT_SECURITY_MIRROR}")
29-
fi
30-
31-
docker build \
21+
docker buildx build \
22+
--platform "linux/${ARCH}" \
23+
--progress=plain \
24+
--provenance=false \
3225
--push \
33-
-t "ghcr.io/superplanehq/superplane-demo:${VERSION}-${ARCH}" \
3426
"${BUILD_ARGS[@]}" \
35-
-f release/superplane-demo-image/Dockerfile . \
27+
-t "ghcr.io/superplanehq/superplane-demo:${VERSION}-${ARCH}" \
28+
-f release/superplane-demo-image/Dockerfile \
29+
.

release/superplane-image/build.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,14 @@ fi
1515

1616
VERSION="$1"
1717
ARCH="$2"
18-
APT_MIRROR="${APT_MIRROR-}"
19-
APT_SECURITY_MIRROR="${APT_SECURITY_MIRROR-}"
2018

2119
echo "Building SuperPlane image"
2220

23-
BUILD_ARGS=()
24-
if [ -n "${APT_MIRROR}" ]; then
25-
BUILD_ARGS+=(--build-arg "APT_MIRROR=${APT_MIRROR}")
26-
fi
27-
if [ -n "${APT_SECURITY_MIRROR}" ]; then
28-
BUILD_ARGS+=(--build-arg "APT_SECURITY_MIRROR=${APT_SECURITY_MIRROR}")
29-
fi
30-
31-
docker build \
21+
docker buildx build \
22+
--platform "linux/${ARCH}" \
23+
--progress=plain \
24+
--provenance=false \
3225
--push \
3326
-t "ghcr.io/superplanehq/superplane:${VERSION}-${ARCH}" \
34-
"${BUILD_ARGS[@]}" \
35-
-f Dockerfile .
27+
-f Dockerfile \
28+
.

0 commit comments

Comments
 (0)