cdi-cloner-container/Dockerfile
Vasily Ulyanov 4e86578e36 Accepting request 1086656 from home:vulyanov:branches:Virtualization
- Make the WORKDIR aligned with the upstream
  The cloner pod is configured to run as a different non-root user and
  an attempt to access /home/cdi-cloner fails with EACCES.

OBS-URL: https://build.opensuse.org/request/show/1086656
OBS-URL: https://build.opensuse.org/package/show/Virtualization/cdi-cloner-container?expand=0&rev=19
2023-05-12 05:57:10 +00:00

37 lines
1.3 KiB
Docker

# Defines the tag for OBS and build script builds:
#!BuildTag: %%TAGPREFIX%%/cdi-cloner:%%PKG_VERSION%%
#!BuildTag: %%TAGPREFIX%%/cdi-cloner:%%PKG_VERSION%%.%RELEASE%
#!BuildTag: %%TAGPREFIX%%/cdi-cloner:%%PKG_VERSION%%-%%PKG_RELEASE%%
#!ExclusiveArch: x86_64 aarch64
# cdi-cloner container image
# KUBEVIRTFROM defined in prjconf, e.g.
# BuildFlags: dockerarg:KUBEVIRTFROM=opensuse/tumbleweed
ARG KUBEVIRTFROM
FROM $KUBEVIRTFROM
# Mandatory labels for the build service:
# https://en.opensuse.org/Building_derived_containers
# labelprefix=%%LABELPREFIX%%
LABEL org.opencontainers.image.title="Cloner container for host assisted cloning"
LABEL org.opencontainers.image.description="Source and Target cloner image for host assisted cloning"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.version="%%PKG_VERSION%%.%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL org.opensuse.reference="%%REGISTRY%%/%%TAGPREFIX%%/cdi-cloner:%%PKG_VERSION%%.%RELEASE%"
# endlabelprefix
RUN zypper -n install \
containerized-data-importer-cloner \
curl \
shadow \
tar \
util-linux && \
zypper clean -a && \
useradd -u 1001 --create-home -s /bin/bash cdi-cloner
WORKDIR /usr/bin
USER 1001
ENTRYPOINT [ "/usr/bin/cloner_startup.sh" ]