Skip to content

Commit

Permalink
use rpm in SLE Dockerfile
Browse files Browse the repository at this point in the history
since we now have the rpm we don't need to build the binary within a container build, we can just zypper install it
  • Loading branch information
stefanotorresi authored Jul 8, 2024
1 parent e66638f commit 3d287d6
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions packaging/suse/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,23 @@
#!UseOBSRepositories
#!ExclusiveArch: x86_64

FROM bci/rust:1.66 AS release
ADD wanda.tar.gz premium-checks.tar.gz* /build/
RUN mv /build/priv/catalog/* /build/wanda/priv/catalog || true && rm -fr /build/priv/
# Workaround for https://github.com/openSUSE/obs-build/issues/487
RUN zypper --non-interactive in sles-release
RUN zypper -n in git-core elixir>=1.15 elixir-hex erlang-rebar3
WORKDIR /build/wanda/
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV MIX_ENV=prod
ENV MIX_HOME=/usr/bin
ENV MIX_REBAR3=/usr/bin/rebar3
ENV MIX_PATH=/usr/lib/elixir/lib/hex/ebin
ENV VERSION=%%VERSION%%
RUN mix phx.digest
RUN mix release
FROM bci/bci-base:15.6

FROM bci/rust:1.66 AS wanda
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.trento
# labelprefix=com.suse.trento.wanda
LABEL org.opencontainers.image.title="Trento Wanda"
LABEL org.opencontainers.image.description="Container image for Trento Wanda server component"
LABEL org.opencontainers.image.url="https://www.trento-project.io"
LABEL org.opencontainers.image.source="https://github.com/trento-project/wanda"
LABEL org.opencontainers.image.version="%%VERSION%%-build%RELEASE%"
# endendlabelprefix

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /app
COPY --from=release /build/wanda/_build/prod/rel/wanda .

RUN zypper -n in trento-wanda

EXPOSE 4000/tcp
ENTRYPOINT ["/app/bin/wanda"]
WORKDIR /usr/lib/wanda/
ENTRYPOINT ["/usr/lib/wanda/bin/wanda"]

0 comments on commit 3d287d6

Please sign in to comment.