This commit is contained in:
parent
54799bacc4
commit
6c6e9a3f7e
5 changed files with 39 additions and 14 deletions
|
|
@ -1,14 +1,23 @@
|
|||
FROM alpine:latest
|
||||
MAINTAINER Juno Takano juno@jutty.dev
|
||||
USER root
|
||||
ENV DEBUG=debug
|
||||
ENV TAG=${TAG:-latest}
|
||||
|
||||
# Setup tooling
|
||||
RUN apk add curl clang
|
||||
RUN apk add curl clang git file
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
|
||||
# Install
|
||||
RUN echo "root_node = 'test'" > /root/graph.toml
|
||||
RUN $HOME/.cargo/bin/cargo install --git https://codeberg.org/jutty/en
|
||||
RUN git clone -b "$TAG" --single-branch https://codeberg.org/jutty/en /build
|
||||
RUN <<EOF
|
||||
cd /build && /root/.cargo/bin/cargo build --locked --release
|
||||
mv /build/target/release/en /usr/local/bin/en
|
||||
rm -rf /build
|
||||
EOF
|
||||
|
||||
# Describe
|
||||
RUN file $(which en) && sha256sum $(which en)
|
||||
|
||||
# Launch
|
||||
CMD ["/root/.cargo/bin/en", "-p", "3008", "-g", "/root/graph.toml"]
|
||||
WORKDIR /root
|
||||
CMD ["en", "-p", "80"]
|
||||
|
|
|
|||
|
|
@ -1,15 +1,24 @@
|
|||
FROM debian:stable-slim
|
||||
MAINTAINER Juno Takano juno@jutty.dev
|
||||
USER root
|
||||
ENV DEBUG=debug
|
||||
ENV TAG=${TAG:-latest}
|
||||
|
||||
# Setup tooling
|
||||
RUN apt-get -y --update install --no-install-recommends \
|
||||
curl ca-certificates gcc libc6-dev
|
||||
curl ca-certificates gcc libc6-dev git file
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
|
||||
# Install
|
||||
RUN echo "root_node = 'test'" > /root/graph.toml
|
||||
RUN $HOME/.cargo/bin/cargo install --git https://codeberg.org/jutty/en
|
||||
RUN git clone -b "$TAG" --single-branch https://codeberg.org/jutty/en /build
|
||||
RUN <<EOF
|
||||
cd /build && /root/.cargo/bin/cargo build --locked --release
|
||||
mv /build/target/release/en /usr/local/bin/en
|
||||
rm -rf /build
|
||||
EOF
|
||||
|
||||
# Describe
|
||||
RUN file $(which en) && sha256sum $(which en)
|
||||
|
||||
# Launch
|
||||
CMD ["/root/.cargo/bin/en", "-p", "3008", "-g", "/root/graph.toml"]
|
||||
WORKDIR /root
|
||||
CMD ["en", "-p", "80"]
|
||||
|
|
|
|||
2
tests/containers/README.md
Normal file
2
tests/containers/README.md
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
## Known issues
|
||||
- Containers will halt and fail to respond to requests with `ERR_CONNECTION_RESET` if the working directory is `/`
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
distro="$1"
|
||||
|
||||
podman build --tag "en-$distro" -f "Containerfile.$distro"
|
||||
podman stop --time 3 "en-$distro"
|
||||
podman build \
|
||||
--tag "en-$distro" \
|
||||
-f "Containerfile.$distro"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
distro="$1"
|
||||
|
||||
podman run --replace --name "en-$distro" --publish 3008:3008 "en-$distro"
|
||||
podman run \
|
||||
--replace \
|
||||
--name "en-$distro" \
|
||||
--publish 3008:80 \
|
||||
"en-$distro"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue