|
1 |
| -# Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved. |
| 1 | +# Copyright (c) 2019-2021 VMware, Inc. All Rights Reserved. |
2 | 2 | # SPDX-License-Identifier: BSD-2-Clause
|
3 | 3 |
|
4 |
| -FROM debian:buster |
| 4 | +FROM python:3.9-slim-buster as base |
5 | 5 |
|
6 |
| -# Install fuse-overlayfs and Tern dependencies |
7 |
| -RUN apt-get update && \ |
8 |
| - apt-get -y install \ |
| 6 | +FROM base as builder |
| 7 | + |
| 8 | +RUN mkdir /install |
| 9 | +WORKDIR /install |
| 10 | + |
| 11 | +COPY dist/tern-*.tar.gz . |
| 12 | +RUN pip install --no-warn-script-location --prefix=/install \ |
| 13 | + tern-*.tar.gz |
| 14 | + |
| 15 | +FROM base |
| 16 | + |
| 17 | +RUN echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list \ |
| 18 | + && echo "Package: *\nPin: release n=bullseye\nPin-Priority: 50" > /etc/apt/preferences.d/bullseye \ |
| 19 | + && apt-get update \ |
| 20 | + && apt-get install -y --no-install-recommends \ |
9 | 21 | attr \
|
10 | 22 | findutils \
|
| 23 | + fuse-overlayfs/bullseye \ |
| 24 | + fuse3/bullseye \ |
11 | 25 | git \
|
12 |
| - gnupg2 \ |
13 | 26 | jq \
|
14 |
| - python3 \ |
15 |
| - python3-pip \ |
16 |
| - python3-setuptools \ |
17 |
| - tar \ |
18 |
| - util-linux \ |
19 |
| - wget && \ |
20 |
| - echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && \ |
21 |
| - wget --no-verbose https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_10/Release.key -O - | apt-key add - && \ |
22 |
| - apt-get update && \ |
23 |
| - apt-get -y install \ |
24 |
| - buildah \ |
25 |
| - fuse-overlayfs && \ |
26 |
| - apt-get clean && \ |
27 |
| - rm -rf /var/lib/apt/lists/* |
28 |
| - |
29 |
| -# Adjust storage.conf to enable Fuse storage. |
30 |
| -RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf |
31 |
| - |
32 |
| -# Install tern with latest changes |
33 |
| -COPY dist/tern-*.tar.gz . |
34 |
| -RUN pip3 install --upgrade pip && \ |
35 |
| - pip3 install --no-cache-dir \ |
36 |
| - tern-*.tar.gz |
| 27 | + && rm -rf /var/lib/apt/lists/* |
| 28 | + |
| 29 | +COPY --from=builder /install /usr/local |
37 | 30 |
|
38 |
| -ENTRYPOINT ["tern", "--driver", "fuse"] |
39 |
| -CMD ["-h"] |
| 31 | +ENTRYPOINT ["tern"] |
| 32 | +CMD ["--help"] |
0 commit comments