-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
FROM python:3.8-slim AS builder | ||
FROM python:3-slim AS base | ||
|
||
LABEL maintainer="Kevin Foo <chfl4gs@qiling.io>" | ||
WORKDIR /qiling | ||
|
||
# hadolint global ignore=DL3008,DL3013 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV AM_I_IN_A_DOCKER_CONTAINER Yes | ||
ENV AM_I_IN_A_DOCKER_CONTAINER=True | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y upgrade \ | ||
&& apt-get install -y --no-install-recommends cmake build-essential gcc git | ||
RUN apt-get update && apt-get -y upgrade && rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
FROM base AS builder | ||
|
||
COPY . /qiling | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
cmake build-essential gcc git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN cd /qiling \ | ||
&& pip wheel . -w wheels | ||
COPY pyproject.toml poetry.lock ./ | ||
RUN pip3 install --no-cache-dir poetry \ | ||
&& poetry install --no-root --no-directory | ||
|
||
FROM python:3.8-slim AS base | ||
COPY qiling/ tests/ examples/ ./ | ||
RUN poetry install --no-dev && poetry build --format=wheel | ||
|
||
FROM base | ||
|
||
LABEL maintainer="Kevin Foo <chfl4gs@qiling.io>" | ||
|
||
COPY --from=builder /qiling /qiling | ||
|
||
WORKDIR /qiling | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends unzip apt-utils \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip3 install --no-deps wheels/*.whl \ | ||
&& rm -rf wheels | ||
|
||
ENV HOME /qiling | ||
&& apt-get install -y --no-install-recommends unzip apt-utils \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip3 install --no-deps --no-cache-dir dist/*.whl \ | ||
&& rm -rf ./dist/ | ||
|
||
CMD bash | ||
CMD ["bash"] |