Unverified Commit a09699fa authored by torgiren's avatar torgiren
Browse files

dockerfile

Signed-off-by: torgiren's avatarMarcin Fabrykowski <git@fabrykowski.pl>
No related merge requests found
Pipeline #3745 passed with stage
in 1 minute and 27 seconds
Showing with 28 additions and 35 deletions
+28 -35
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
stages:
- build
# Build a Docker image with CI/CD and push to the GitLab registry.
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#
# This template uses one generic job with conditional builds
# for the default branch and all other (MR) branches.
docker-build:
# Use the official docker image.
image: docker:latest
build:
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
image: quay.io/podman/stable:v4
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
- echo -n $CI_REGISTRY_PASSWORD | podman login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- >
podman build
--pull
--tag $CI_REGISTRY_IMAGE:latest
.
- podman push $CI_REGISTRY_IMAGE:latest
Dockerfile 0 → 100644
FROM fedora:latest
RUN dnf install openssh-server git tini python3 python3-pip -y
RUN dnf reinstall -y man bash coreutils-common man-pages curl wget --setopt='tsflags='
RUN dnf install -y man bash coreutils-common man-pages curl wget cmatrix --setopt='tsflags='
RUN ssh-keygen -A
RUN useradd -m -s /bin/bash user
RUN echo "user:passwd13" | chpasswd
#RUN echo "user:p2ss@w0rd13" | chpasswd
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
RUN git clone https://github.com/torgiren/flask-htmx-demo.git /tmp/flask-htmx-demo
RUN cp -r /tmp/flask-htmx-demo/flask-htmx-order /opt/flask-app
RUN chown -R user:user /opt/flask-app
RUN pip install -r /tmp/flask-htmx-demo/requirements.txt
RUN systemctl enable sshd
#ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/lib/systemd/systemd"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment