Add dev containers, musl build
This commit is contained in:
parent
23cd51fc95
commit
d9341e7686
6 changed files with 86 additions and 36 deletions
13
tests/containers/Containerfile.alpine-dev
Normal file
13
tests/containers/Containerfile.alpine-dev
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
FROM docker.io/library/rust:alpine
|
||||
MAINTAINER Juno Takano juno@jutty.dev
|
||||
ENV DEBUG=debug
|
||||
|
||||
# Install
|
||||
COPY en /usr/local/bin/en
|
||||
|
||||
# Describe
|
||||
RUN sha256sum $(which en)
|
||||
|
||||
# Launch
|
||||
WORKDIR /root
|
||||
CMD ["en", "-p", "80"]
|
||||
13
tests/containers/Containerfile.debian-dev
Normal file
13
tests/containers/Containerfile.debian-dev
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
FROM debian:stable-slim
|
||||
MAINTAINER Juno Takano juno@jutty.dev
|
||||
ENV DEBUG=debug
|
||||
|
||||
# Install
|
||||
COPY en /usr/local/bin/en
|
||||
|
||||
# Describe
|
||||
RUN sha256sum $(which en)
|
||||
|
||||
# Launch
|
||||
WORKDIR /root
|
||||
CMD ["en", "-p", "80"]
|
||||
|
|
@ -1,9 +1,21 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
distro="$1"
|
||||
suffix=$(printf '%s' "$1" | sed 's/.*\.//')
|
||||
tag="en:$suffix"
|
||||
|
||||
if podman container exists "$tag"; then
|
||||
podman stop --time 3 "$tag"
|
||||
fi
|
||||
|
||||
if [ "$suffix" = 'debian-dev' ]; then
|
||||
cp ../../target/release/en en
|
||||
elif [ "$suffix" = 'alpine-dev' ]; then
|
||||
cp ../../target/x86_64-unknown-linux-musl/release/en en
|
||||
fi
|
||||
|
||||
podman stop --time 3 "en-$distro"
|
||||
podman build \
|
||||
--tag "en-$distro" \
|
||||
-f "Containerfile.$distro"
|
||||
--tag "$tag" \
|
||||
-f "Containerfile.$suffix"
|
||||
|
||||
rm en
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
distro="$1"
|
||||
suffix=$(printf '%s' "$1" | sed 's/.*\.//')
|
||||
name="en-$suffix"
|
||||
tag="en:$suffix"
|
||||
|
||||
podman run \
|
||||
--replace \
|
||||
--name "en-$distro" \
|
||||
--name "$name" \
|
||||
--publish 3008:80 \
|
||||
"en-$distro"
|
||||
"$tag"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue