mirror of
https://github.com/Portabase/agent.git
synced 2026-09-11 14:00:14 +00:00
fix: Dockerfile
This commit is contained in:
@@ -1,198 +1,3 @@
|
||||
#name: Docker Publish
|
||||
#
|
||||
#on:
|
||||
# workflow_call:
|
||||
# inputs:
|
||||
# image_name:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: 'portabase/agent'
|
||||
# add_latest:
|
||||
# required: false
|
||||
# type: boolean
|
||||
# default: false
|
||||
# target:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: 'prod'
|
||||
# dockerfile:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: './docker/Dockerfile'
|
||||
# secrets:
|
||||
# DOCKER_USERNAME:
|
||||
# required: true
|
||||
# DOCKER_PASSWORD:
|
||||
# required: true
|
||||
#
|
||||
#jobs:
|
||||
# build-and-push:
|
||||
# runs-on: ubuntu-latest
|
||||
# permissions:
|
||||
# packages: write
|
||||
# contents: read
|
||||
# steps:
|
||||
# - name: Check out the repo
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# fetch-depth: 0
|
||||
#
|
||||
# - name: Set up QEMU (enables multi-arch emulation)
|
||||
# uses: docker/setup-qemu-action@v3
|
||||
#
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v3
|
||||
#
|
||||
# - name: Log in to Docker Hub
|
||||
# uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
#
|
||||
# - name: Set tags
|
||||
# id: set-tags
|
||||
# run: |
|
||||
# REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
# TAGS="${{ inputs.image_name }}:$REF_NAME"
|
||||
# if [[ "${{ inputs.add_latest }}" == "true" ]]; then
|
||||
# TAGS="$TAGS,${{ inputs.image_name }}:latest"
|
||||
# fi
|
||||
# echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
||||
#
|
||||
# - name: Build and push Docker image
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# file: ${{ inputs.dockerfile }}
|
||||
# platforms: linux/amd64,linux/arm64
|
||||
# push: true
|
||||
# tags: ${{ steps.set-tags.outputs.tags }}
|
||||
# target: ${{ inputs.target }}
|
||||
#
|
||||
#name: Docker Publish
|
||||
#
|
||||
#on:
|
||||
# workflow_call:
|
||||
# inputs:
|
||||
# image_name:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: 'portabase/agent'
|
||||
# add_latest:
|
||||
# required: false
|
||||
# type: boolean
|
||||
# default: false
|
||||
# target:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: 'prod'
|
||||
# dockerfile:
|
||||
# required: false
|
||||
# type: string
|
||||
# default: './docker/Dockerfile'
|
||||
# secrets:
|
||||
# DOCKER_USERNAME:
|
||||
# required: true
|
||||
# DOCKER_PASSWORD:
|
||||
# required: true
|
||||
#
|
||||
#jobs:
|
||||
# build-amd64:
|
||||
# name: Build AMD64 Image
|
||||
# runs-on: ubuntu-latest
|
||||
# outputs:
|
||||
# image: ${{ steps.set-job-output.outputs.image }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
#
|
||||
# - uses: docker/setup-buildx-action@v3
|
||||
#
|
||||
# - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
#
|
||||
# - name: Set AMD64 image tag
|
||||
# id: set-tags
|
||||
# run: |
|
||||
# REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
# AMD64_IMAGE="${{ inputs.image_name }}:$REF_NAME-amd64"
|
||||
# echo "amd64_image=$AMD64_IMAGE" >> $GITHUB_OUTPUT
|
||||
#
|
||||
# - name: Build and push AMD64
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# file: ${{ inputs.dockerfile }}
|
||||
# platforms: linux/amd64
|
||||
# push: true
|
||||
# tags: ${{ steps.set-tags.outputs.amd64_image }}
|
||||
# target: ${{ inputs.target }}
|
||||
#
|
||||
# build-arm64:
|
||||
# name: Build ARM64 Image
|
||||
# runs-on: ubuntu-24.04-arm
|
||||
# outputs:
|
||||
# image: ${{ steps.set-job-output.outputs.image }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
#
|
||||
# - uses: docker/setup-buildx-action@v3
|
||||
#
|
||||
# - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
#
|
||||
# - name: Set ARM64 image tag
|
||||
# id: set-tags
|
||||
# run: |
|
||||
# REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
# ARM64_IMAGE="${{ inputs.image_name }}:$REF_NAME-arm64"
|
||||
# echo "arm64_image=$ARM64_IMAGE" >> $GITHUB_OUTPUT
|
||||
#
|
||||
# - name: Build and push ARM64
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# file: ${{ inputs.dockerfile }}
|
||||
# platforms: linux/arm64
|
||||
# push: true
|
||||
# tags: ${{ steps.set-tags.outputs.arm64_image }}
|
||||
# target: ${{ inputs.target }}
|
||||
#
|
||||
#
|
||||
# create-manifest:
|
||||
# name: Create Multi-Arch Manifest
|
||||
# runs-on: ubuntu-latest
|
||||
# needs:
|
||||
# - build-amd64
|
||||
# - build-arm64
|
||||
# steps:
|
||||
# - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
#
|
||||
# - name: Create Docker manifest
|
||||
# run: |
|
||||
# REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
#
|
||||
# IMAGE="${{ inputs.image_name }}:$REF_NAME"
|
||||
# AMD64_IMAGE="$IMAGE-amd64"
|
||||
# ARM64_IMAGE="$IMAGE-arm64"
|
||||
#
|
||||
# echo "AMD64_IMAGE=$AMD64_IMAGE"
|
||||
# echo "ARM64_IMAGE=$ARM64_IMAGE"
|
||||
#
|
||||
# docker manifest create $IMAGE $AMD64_IMAGE $ARM64_IMAGE
|
||||
# docker manifest push $IMAGE
|
||||
#
|
||||
# if [ "${{ inputs.add_latest }}" = "true" ]; then
|
||||
# docker manifest create ${{ inputs.image_name }}:latest $AMD64_IMAGE $ARM64_IMAGE
|
||||
# docker manifest push ${{ inputs.image_name }}:latest
|
||||
# fi
|
||||
|
||||
name: Docker Publish
|
||||
|
||||
on:
|
||||
@@ -296,21 +101,6 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# - name: Create and push manifest
|
||||
# run: |
|
||||
# AMD64_IMAGE=$(cat /tmp/digests/amd64/image.txt)
|
||||
# ARM64_IMAGE=$(cat /tmp/digests/arm64/image.txt)
|
||||
# REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
# MANIFEST_IMAGE="${{ inputs.image_name }}:$REF_NAME"
|
||||
#
|
||||
# docker manifest create $MANIFEST_IMAGE $AMD64_IMAGE $ARM64_IMAGE
|
||||
# docker manifest push $MANIFEST_IMAGE
|
||||
#
|
||||
# if [ "${{ inputs.add_latest }}" = "true" ]; then
|
||||
# docker manifest create ${{ inputs.image_name }}:latest $AMD64_IMAGE $ARM64_IMAGE
|
||||
# docker manifest push ${{ inputs.image_name }}:latest
|
||||
# fi
|
||||
|
||||
- name: Create and push manifest list
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
|
||||
Generated
+1
-1
@@ -1595,7 +1595,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
|
||||
|
||||
[[package]]
|
||||
name = "portabase-agent"
|
||||
version = "1.0.4-rc.19"
|
||||
version = "1.0.4-rc.20"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
@@ -110,126 +110,3 @@ COPY --from=base /usr/local/mongodb/bin/ /usr/local/mongodb/bin/
|
||||
ENV APP_ENV=production
|
||||
|
||||
CMD ["/entrypoint.sh"]
|
||||
|
||||
# =========================
|
||||
# Base image (shared)
|
||||
# =========================
|
||||
#FROM rust:1.92.0 AS base
|
||||
#
|
||||
#RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
# pkg-config \
|
||||
# libssl-dev \
|
||||
# tzdata \
|
||||
# redis-server \
|
||||
# ca-certificates \
|
||||
# libpq5 \
|
||||
# libreadline8 \
|
||||
# libncurses6 \
|
||||
# zlib1g \
|
||||
# curl \
|
||||
# mariadb-client \
|
||||
# && apt-get clean \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
#ARG TARGETARCH
|
||||
#
|
||||
## =========================
|
||||
## PostgreSQL client binaries (versions 12-18)
|
||||
## =========================
|
||||
#RUN for v in 12 13 14 15 16 17 18; do mkdir -p /usr/lib/postgresql/$v/bin; done
|
||||
#
|
||||
#COPY assets/tools/amd64/postgresql/ /tmp/pg-x64/
|
||||
#COPY assets/tools/arm64/postgresql/ /tmp/pg-arm/
|
||||
#
|
||||
#RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||
# for v in 12 13 14 15 16 17 18; do \
|
||||
# cp -r /tmp/pg-x64/postgresql-$v/bin/* /usr/lib/postgresql/$v/bin/; \
|
||||
# done; \
|
||||
# else \
|
||||
# for v in 12 13 14 15 16 17 18; do \
|
||||
# cp -r /tmp/pg-arm/postgresql-$v/bin/* /usr/lib/postgresql/$v/bin/; \
|
||||
# done; \
|
||||
# fi && \
|
||||
# rm -rf /tmp/pg-x64 /tmp/pg-arm && \
|
||||
# chmod +x /usr/lib/postgresql/*/bin/*
|
||||
#
|
||||
## =========================
|
||||
## MongoDB client binaries
|
||||
## =========================
|
||||
#COPY assets/tools/${TARGETARCH}/mongodb/ /usr/local/mongodb/
|
||||
#RUN chmod +x /usr/local/mongodb/bin/*
|
||||
#
|
||||
#WORKDIR /app
|
||||
#
|
||||
## =========================
|
||||
## Development image
|
||||
## =========================
|
||||
#FROM base AS dev
|
||||
#
|
||||
#RUN cargo install cargo-watch
|
||||
#
|
||||
#COPY Cargo.toml Cargo.lock ./
|
||||
#RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
#RUN cargo build
|
||||
#RUN rm -rf src
|
||||
#
|
||||
#COPY entrypoint.sh /entrypoint.sh
|
||||
#RUN chmod +x /entrypoint.sh
|
||||
#
|
||||
#CMD ["/entrypoint.sh"]
|
||||
#
|
||||
## =========================
|
||||
## Builder (production)
|
||||
## =========================
|
||||
#FROM base AS builder
|
||||
#
|
||||
#ARG TARGETARCH
|
||||
#
|
||||
#RUN rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
|
||||
#
|
||||
#COPY . .
|
||||
#
|
||||
#RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||
# cargo build --release --target x86_64-unknown-linux-gnu && \
|
||||
# mv /app/target/x86_64-unknown-linux-gnu/release /app/target/release-app; \
|
||||
# else \
|
||||
# cargo build --release --target aarch64-unknown-linux-gnu && \
|
||||
# mv /app/target/aarch64-unknown-linux-gnu/release /app/target/release-app; \
|
||||
# fi
|
||||
#
|
||||
#
|
||||
#RUN echo "APP_VERSION=$(cargo pkgid | awk -F# '{print $2}')" > /app/version.env
|
||||
#
|
||||
## =========================
|
||||
## Runtime (production)
|
||||
## =========================
|
||||
#FROM ubuntu:24.04 AS prod
|
||||
#
|
||||
#RUN apt-get update && apt-get install -y \
|
||||
# redis-server \
|
||||
# ca-certificates \
|
||||
# tzdata \
|
||||
# libpq5 \
|
||||
# libreadline8 \
|
||||
# libncurses6 \
|
||||
# zlib1g \
|
||||
# mariadb-client \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
#WORKDIR /app
|
||||
#
|
||||
#ARG TARGETARCH
|
||||
#
|
||||
#COPY --from=builder /app/target/release-app/app /usr/local/bin/app
|
||||
#
|
||||
#COPY --from=builder /app/version.env /app/version.env
|
||||
#COPY entrypoint.sh /entrypoint.sh
|
||||
#RUN chmod +x /entrypoint.sh
|
||||
#
|
||||
#COPY --from=base /usr/lib/postgresql/ /usr/lib/postgresql/
|
||||
#COPY --from=base /usr/local/mongodb/bin/ /usr/local/mongodb/bin/
|
||||
#
|
||||
#ENV APP_ENV=production
|
||||
#
|
||||
#CMD ["/entrypoint.sh"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user