Git Product home page Git Product logo

docker.from.scratch.python's Introduction

docker.from.scratch.python

simpleapi:ZIP.3.0.1

# BUILD
FROM python:3.10-slim AS build
WORKDIR "/app"
RUN apt-get update ; \
    apt-get install binutils build-essential gcc libc-bin patchelf -y ; \
    apt-get clean ;
ADD requirements.txt requirements.txt
RUN python -m pip install --no-cache-dir --upgrade pip ; \
    python -m pip install --no-cache-dir --upgrade -r requirements.txt ;
ADD simpleapi.py simpleapi.py
RUN pyinstaller --onefile --name simpleapi simpleapi.py ; \
    cd dist ; \
    staticx simpleapi simpleapi ;

# RELEASE
FROM scratch
WORKDIR "/app"
COPY tmp /tmp
COPY --from=build /app/dist/simpleapi /app/simpleapi
ENTRYPOINT [ "/app/simpleapi" ]
cat requirements.txt
flask
patchelf-wrapper
pyinstaller
requests
scons
staticx
docker build -f Dockerfile -t simpleapi:ZIP.3.0.1 .
docker run -it -p 8082:5000 --name simpleapi_02 simpleapi:ZIP.3.0.1
docker run --rm -d -p 8081:5000 --name simpleapi-zip-01 simpleapi:ZIP.3.0.1
#
docker image ls | grep simpleapi | sort
simpleapi                    ZIP.3.0.0   ad919f96f188   2 hours ago         10.4MB
simpleapi                    ZIP.3.0.1   32447c0d34e1   About an hour ago   9.45MB
#
yz.registry:5000/simpleapi   ZIP.2.1.0   25492a0138d0   2 days ago          15.9MB
yz.registry:5000/simpleapi   ZIP.3.0.1   32447c0d34e1   About an hour ago   9.45MB
docker tag simpleapi:ZIP.3.0.1 yz.registry:5000/simpleapi:ZIP.3.0.1
docker push yz.registry:5000/simpleapi:ZIP.3.0.1

docker.from.scratch.python's People

Contributors

yzarca avatar

Watchers

Francesco Sblendorio avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.