Browse Source

Specify file path while copying

Just to be sure.
merge-requests/226/head
Jonas Zohren 4 years ago
parent
commit
ff60e72642
No known key found for this signature in database
GPG Key ID: FE3ED5D90A175463
  1. 32
      .gitlab-ci.yml
  2. 4
      Dockerfile
  3. 2
      docker/ci-binaries-packaging.Dockerfile

32
.gitlab-ci.yml

@ -157,22 +157,46 @@ build:debug:cargo:x86_64-unknown-linux-musl:
- mkdir -p linux/arm/ && mv ./conduit-arm-unknown-linux-musleabihf linux/arm/v6 - mkdir -p linux/arm/ && mv ./conduit-arm-unknown-linux-musleabihf linux/arm/v6
- mkdir -p linux/arm/ && mv ./conduit-armv7-unknown-linux-musleabihf linux/arm/v7 - mkdir -p linux/arm/ && mv ./conduit-armv7-unknown-linux-musleabihf linux/arm/v7
- mv ./conduit-aarch64-unknown-linux-musl linux/arm64 - mv ./conduit-aarch64-unknown-linux-musl linux/arm64
- 'export CREATED=$(date -u +''%Y-%m-%dT%H:%M:%SZ'') && echo "Docker image creation date: $CREATED"'
# Actually create multiarch image: # Actually create multiarch image:
- >
docker buildx build
--pull
--build-arg CREATED=$CREATED
--build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml)
--build-arg "GIT_REF=$CI_COMMIT_SHORT_SHA"
--platform "$PLATFORMS"
--tag "$GL_IMAGE_TAG"
--tag "$GL_IMAGE_TAG-commit-$CI_COMMIT_SHORT_SHA"
--tag "$DH_IMAGE_TAG"
--tag "$DH_IMAGE_TAG-$CI_COMMIT_SHORT_SHA"
--file "$DOCKER_FILE" .
# Re-use the cached build (thus not recompiling Conduit) and then --push it to GitLab
- > - >
docker buildx build docker buildx build
--pull --pull
--push --push
--build-arg CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') --build-arg CREATED=$CREATED
--build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) --build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml)
--build-arg "GIT_REF=$CI_COMMIT_SHORT_SHA" --build-arg "GIT_REF=$CI_COMMIT_SHORT_SHA"
--platform "$PLATFORMS" --platform "$PLATFORMS"
--tag "$GL_IMAGE_TAG" --tag "$GL_IMAGE_TAG"
--tag "$GL_IMAGE_TAG-commit-$CI_COMMIT_SHORT_SHA" --tag "$GL_IMAGE_TAG-commit-$CI_COMMIT_SHORT_SHA"
--tag "$LOCAL_DH_IMAGE_TAG"
--file "$DOCKER_FILE" . --file "$DOCKER_FILE" .
# Only try to push to docker hub, if auth data for dockerhub exists: # Only try to push to docker hub, if auth data for dockerhub exists:
- if [ -n "${DOCKER_HUB}" ]; then docker push "$DH_IMAGE_TAG"; fi - >
- if [ -n "${DOCKER_HUB}" ]; then docker push "$DH_IMAGE_TAG-commit-$CI_COMMIT_SHORT_SHA"; fi if [ -n "${DOCKER_HUB}" ]; then
docker buildx build
--pull
--push
--build-arg CREATED=$CREATED
--build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml)
--build-arg "GIT_REF=$CI_COMMIT_SHORT_SHA"
--platform "$PLATFORMS"
--tag "$DH_IMAGE_TAG"
--tag "$DH_IMAGE_TAG-$CI_COMMIT_SHORT_SHA"
--file "$DOCKER_FILE" .
; fi
build:docker:next: build:docker:next:
extends: .docker-shared-settings extends: .docker-shared-settings

4
Dockerfile

@ -54,11 +54,11 @@ RUN apk add --no-cache \
RUN mkdir -p /srv/conduit/.local/share/conduit RUN mkdir -p /srv/conduit/.local/share/conduit
# Test if Conduit is still alive, uses the same endpoint as Element # Test if Conduit is still alive, uses the same endpoint as Element
COPY ./docker/healthcheck.sh /srv/conduit/ COPY ./docker/healthcheck.sh /srv/conduit/healthcheck.sh
HEALTHCHECK --start-period=5s --interval=5s CMD ./healthcheck.sh HEALTHCHECK --start-period=5s --interval=5s CMD ./healthcheck.sh
# Copy over the actual Conduit binary from the builder stage # Copy over the actual Conduit binary from the builder stage
COPY --from=builder /usr/src/conduit/target/release/conduit /srv/conduit/ COPY --from=builder /usr/src/conduit/target/release/conduit /srv/conduit/conduit
# Improve security: Don't run stuff as root, that does not need to run as root: # Improve security: Don't run stuff as root, that does not need to run as root:
# Add www-data user and group with UID 82, as used by alpine # Add www-data user and group with UID 82, as used by alpine

2
docker/ci-binaries-packaging.Dockerfile

@ -47,7 +47,7 @@ LABEL org.opencontainers.image.created=${CREATED} \
RUN mkdir -p /srv/conduit/.local/share/conduit RUN mkdir -p /srv/conduit/.local/share/conduit
# Test if Conduit is still alive, uses the same endpoint as Element # Test if Conduit is still alive, uses the same endpoint as Element
COPY ./docker/healthcheck.sh /srv/conduit/ COPY ./docker/healthcheck.sh /srv/conduit/healthcheck.sh
HEALTHCHECK --start-period=5s --interval=5s CMD ./healthcheck.sh HEALTHCHECK --start-period=5s --interval=5s CMD ./healthcheck.sh

Loading…
Cancel
Save