-
Notifications
You must be signed in to change notification settings - Fork 29
/
nreqs.Dockerfile
56 lines (54 loc) · 2.04 KB
/
nreqs.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Simple dockerfile to create an image that can run the TCF client
#
# Build as:
#
# # cd .../tcf.git
# $ buildah bud -t tcf -v $PWD:/home/work/tcf.git:O --label version="$(git describe --always)" -f client.Dockerfile
#
# Run under the container without registry::
#
# $ podman run -v $HOME/.tcf:/home/work/.tcf:O tcf ls
#
# Push to a registry::
#
# $ buildah push localhost/tcf REGISTRY/IMAGENAME/tcf:latest
#
# Run under the the container::
#
# $ podman run -v $HOME/.tcf:/home/work/.tcf:O tcf tcf ls
#
# don't use fedora-minimal or it'll start pruning things we need (like /usr/share/zoneinfo)
FROM registry.fedoraproject.org/fedora:34
LABEL maintainer https://github.com/intel/tcf
COPY . /home/work/tcf.git
# We also add multiple tools for diagnosing that at the end we always need
# chmod: when we run inside Jenkins, it'll use which ever UID it uses
# (can't control it), so we need /home/work world accesible
# pip3 install: our setup is a wee messed up at this point
# sed -> quick hack because it's late and I am done with this
# rm -rf : leftover lib from pip3 removed
# chmod: when we run inside Jenkins, it'll use which ever UID it uses
# (can't control it), so we need /home/work world accesible
#
# Note --skip-packages=tcf-client to nreqs; we try to install in this
# container images all the deps needed to build TCF itself, but it picks
# up also the ones needed to run the server (the client package) so
# when building the container we tell it to skip that.
RUN \
chmod a+rwX -R /home/work && \
dnf install -y python3-pip python3-yaml && \
DNF_COMMAND=dnf /home/work/tcf.git/nreqs.py install --skip-package=tcf-client /home/work/tcf.git && \
dnf install -y \
bind-utils \
iputils \
strace && \
dnf clean all && \
cd /home/work/tcf.git && \
pip3 install . --root=/ --prefix=/ && \
sed -i 's|#!python|#! /usr/bin/env python3|' /usr/bin/tcf && \
rm -rf lib
# we run this from the source package, we do not install it
ENV HOME=/home/work
WORKDIR /home/work
ENTRYPOINT [ "tcf" ]