From 1e5324823e7111149d3eda710f54c9efd3dc966e Mon Sep 17 00:00:00 2001 From: Ben Binder Date: Sun, 23 Feb 2025 21:50:42 -0600 Subject: [PATCH] Adjust Dockerfile and pipeline. --- .drone.yml | 8 ++++++++ Dockerfile | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2b95539..33d94cf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,8 +20,16 @@ steps: - name: deploy image: alpine + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + DOCKER_USERNAME: + from_secret: DOCKER_USERNAME + DOCKER_PASSWORD: + from_secret: DOCKER_PASSWORD commands: - echo "Deploying new version..." + - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin registry.binderlab.io - docker pull registry.binderlab.io/harbormaster:latest - docker stop harbormaster || true - docker rm harbormaster || true diff --git a/Dockerfile b/Dockerfile index 4c33d3c..e060921 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN go mod download COPY . . # Build the application -RUN go build -o your-app-name . +RUN go build -o harbormaster . # Use a small base image for the final container FROM alpine:latest @@ -23,7 +23,7 @@ FROM alpine:latest WORKDIR /root/ # Copy the compiled binary from the builder stage -COPY --from=builder /app/your-app-name . +COPY --from=builder /app/harbormaster . # Expose the port the app runs on EXPOSE 8080