在更新Docker(最新的19.03.13)和postgres(从12到13)之后,我的gitlab管道现在失败了-没有任何痕迹。它被触发,但是拉动在1秒后失败,没有任何痕迹。
Gitlab运行程序正在运行,并且未与其他项目共享。 Docker连接到注册表,可以构建和推送更新的映像。 尝试克隆到新的repo并重做gitlab运行程序注册。尚未发现此处发布的任何其他类似问题。已经用尽了什么尝试的想法。
任何帮助将不胜感激!
The pipeline output (ie no output)
我的.gitlab-ci.yml
stages:
- pull
- build
- lint
- push
- cleanup
- deploy
before_script:
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
pull:
stage: pull
allow_failure: true
script:
- docker pull "$CI_REGISTRY_IMAGE":latest
build:
stage: build
script:
- docker build --tag="$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" --cache-from="$CI_REGISTRY_IMAGE":latest .
lint:
stage: lint
script:
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app ls
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app cat tox.ini
- export CI_PIPELINE_ID=$CI_PIPELINE_ID
- export CI_BUILD_REF_NAME=$CI_COMMIT_REF_NAME
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app flake8 .
push image:
stage: push
only:
- master
- tags
script:
- docker tag "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
- docker push "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
push latest:
stage: push
script:
- docker tag "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" "$CI_REGISTRY_IMAGE":latest
- docker push "$CI_REGISTRY_IMAGE":latest
cleanup:
stage: cleanup
when: always
script:
- docker rmi -f "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME"
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml down --remove-orphans
deploy:
stage: deploy
when: manual
only:
- master
- tags
script:
- docker-compose -f docker-compose.deploy.yml pull
- docker-compose -f docker-compose.deploy.yml down --remove-orphans
- docker-compose -f docker-compose.deploy.yml up -d
我的docker-compose.ci.yml
version: "3"
services:
app:
image: "${CI_PIPELINE_ID}:${CI_BUILD_REF_NAME}"
我的docker-compose.yml
version: "3"
services:
backend:
image: registry.gitlab.com/my_account/my_project:latest
env_file:
- dev.env
ports:
- "8000:8000"
- "4777:22"
volumes:
- ./backend:/backend
command: "/usr/sbin/sshd -D"
depends_on:
- postgres
postgres:
image: postgres:latest
restart: always
env_file:
- dev.env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
volumes:
postgres:
static-files:
media-files:
我的docker-compose.deploy.yml
version: "3"
services:
backend:
image: registry.gitlab.com/my_account/my_project:latest
command: "sh /scripts/run.sh"
env_file:
- dev.env
depends_on:
- postgres
volumes:
- media-files:/media-files
- static-files:/static-files
- frontend:/frontend-build
postgres:
image: postgres:latest
env_file:
- dev.env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt
- static-files:/static-files/
- media-files:/media-files/
- frontend:/frontend
volumes:
postgres:
static-files:
media-files:
frontend:
我的Dockerfile
FROM continuumio/miniconda:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && apt-get upgrade -y && apt-get install -qqy \
wget \
bzip2 \
graphviz \
libssl-dev \
openssh-server
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get update && apt-get install -y nodejs
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN mkdir -p /backend
COPY ./backend/requirements.yml /backend/requirements.yml
RUN /opt/conda/bin/conda env create -f /backend/requirements.yml
ENV PATH /opt/conda/envs/backend/bin:$PATH
ENV PYTHONDONTWRITEBYTECODE 1
RUN echo "source activate backend" >~/.bashrc
COPY ./scripts /scripts
RUN chmod +x ./scripts*
COPY ./backend /backend
COPY ./frontend /frontend
WORKDIR /frontend
RUN npm install && npm run build
WORKDIR /backend