From cf167a179237e51e65245aa5b956501ade6ad0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Thu, 3 Dec 2020 10:30:01 +0100 Subject: [PATCH] initial commit --- .gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..57dd744 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +image: docker:19.03 +services: + - docker:19.03-dind +variables: + DOCKER_DRIVER: overlay + DOCKER_TLS_CERTDIR: "" +stages: + - buildx + - deploy + +buildx: + image: docker:19.03-git + stage: buildx + variables: + GIT_STRATEGY: none + artifacts: + paths: + - buildx + expire_in: 3 hour + services: + - docker:19.03-dind + script: + - export DOCKER_BUILDKIT=1 + - git clone git://github.com/docker/buildx ./docker-buildx + - docker build --platform=local -o . ./docker-buildx + only: + changes: + - Dockerfile + - .gitlab-ci.yml + except: + - schedules + +deploy: + image: docker:19.03 + stage: deploy + services: + - name: docker:19.03-dind + command: ["--experimental"] + before_script: + - mkdir -p ~/.docker/cli-plugins + - mv buildx ~/.docker/cli-plugins/docker-buildx + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker buildx create --use --name mybuilder + - docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push -t $CI_REGISTRY_IMAGE:latest . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e5efa4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:latest +#MAINTAINER Maƫl Auzias + + +# python3 +RUN adduser -S python +RUN apk --no-cache add python3 + +# pip3 +RUN apk --no-cache add curl \ + ca-certificates \ + && curl -O https://bootstrap.pypa.io/get-pip.py \ + && python3 get-pip.py \ + && rm get-pip.py + +RUN ls -lha /usr/lib/ +RUN pip install zerobin \ + && chown python:root -R /usr/lib/python*/site-packages/zerobin/ + +USER python + +ENTRYPOINT [ "zerobin", "--host=0.0.0.0" ]