1
1
#syntax=docker/dockerfile:1.12.1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25
2
2
3
+ FROM ghcr.io/uniget-org/tools/go:latest AS go
4
+ FROM ghcr.io/uniget-org/tools/goreleaser:latest AS goreleaser
5
+
3
6
FROM registry.gitlab.com/uniget-org/images/ubuntu:24.04 AS prepare
4
7
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
5
8
/etc/profile.d/ \
6
9
/etc/profile.d/
7
10
SHELL [ "bash", "-clo", "errexit" ]
8
11
ARG name
9
12
ARG version
10
- RUN --mount=type=cache,target=/var/cache/uniget/download <<EOF
11
- url="https://github.com/valyentdev/ravel/releases/download/v${version}/ravel_${version}_linux_${alt_arch}.tar.gz"
12
- filename="$( basename "${url}" )"
13
- check-github-release-asset "valyentdev/ravel" "v${version}" "${filename}"
14
- curl --silent --show-error --location --fail --output "${uniget_cache_download}/${filename}" \
15
- "${url}"
16
-
17
- tar --file="${uniget_cache_download}/${filename}" --list
18
- tar --file="${uniget_cache_download}/${filename}" --extract --gzip --directory="${prefix}/bin" --no-same-owner \
19
- ravel
20
-
21
- curl --silent --show-error --location --fail --output "${prefix}/etc/systemd/system/ravel.service.go-template" \
22
- "https://github.com/valyentdev/ravel/blob/v${version}/docs/init/ravel.service"
23
- sed -E -i "s|ExecStart=/usr/local/bin/ravel|ExecStart={{ .Target }}/bin/ravel|" "${prefix}/etc/systemd/system/ravel.service.go-template"
13
+ COPY --link --from=go / /usr/local/
14
+ COPY --link --from=goreleaser / /usr/local/
15
+ WORKDIR /go/src/github.com/valyentdev/ravel
16
+ ARG name
17
+ ARG version
18
+ RUN --mount=type=cache,target=/root/go/pkg/mod <<EOF
19
+ check-clone "https://github.com/valyentdev/ravel" "v${version}"
20
+ git clone -q --config advice.detachedHead=false --depth 1 --branch "v${version}" https://github.com/valyentdev/ravel .
21
+ goreleaser build --single-target
22
+ cp \
23
+ dist/ravel_linux_amd64_v1/ravel \
24
+ dist/initd_linux_amd64_v1/initd \
25
+ dist/ravel-proxy_linux_amd64_v1/ravel-proxy \
26
+ dist/jailer_linux_amd64_v1/jailer \
27
+ "${prefix}/bin/"
28
+ EOF
24
29
30
+ RUN <<EOF
25
31
"${prefix}/bin/ravel" completion bash >"${prefix}/share/bash-completion/completions/ravel"
26
32
"${prefix}/bin/ravel" completion fish >"${prefix}/share/fish/vendor_completions.d/ravel.fish"
27
33
"${prefix}/bin/ravel" completion zsh >"${prefix}/share/zsh/vendor-completions/_ravel"
34
+
35
+ "${prefix}/bin/ravel-proxy" completion bash >"${prefix}/share/bash-completion/completions/ravel-proxy"
36
+ "${prefix}/bin/ravel-proxy" completion fish >"${prefix}/share/fish/vendor_completions.d/ravel-proxy.fish"
37
+ "${prefix}/bin/ravel-proxy" completion zsh >"${prefix}/share/zsh/vendor-completions/_ravel-proxy"
28
38
EOF
0 commit comments