Skip to content

Commit

Permalink
Attempt to pin to run-specific image
Browse files Browse the repository at this point in the history
  • Loading branch information
danschmidt5189 committed Dec 5, 2024
1 parent 194acfc commit 406fde1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:

env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml
DOCKER_APP_IMAGE: app-run-${{ github.run_id}}

outputs:
imageid: ${{ steps.image }}
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
edu.berkeley.lib.git-repository-url=${{ github.repositoryUrl }}
edu.berkeley.lib.git-sha=${{ github.sha }}
tags: |
type=raw,value=${{ env.DOCKER_APP_IMAGE }}
type=sha
type=ref,event=branch
type=ref,event=pr
Expand All @@ -87,10 +89,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

- name: Set the application image
run: |
echo DOCKER_APP_IMAGE=${{ steps.image.outputs.imageid }} >> "$GITHUB_ENV"
- name: Start the stack
run: |
docker compose up --build --detach
Expand Down
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ RUN mkdir -p /opt/app \
&& chown -R $APP_USER:$APP_USER /opt/app /usr/local/bundle

# Get list of available packages
RUN apt-get update -qq
RUN apt-get update -qq

# Install standard packages from the Debian repository
RUN apt-get install -y --no-install-recommends \
bash \
curl \
default-jre \
ca-certificates \
ca-certificates \
nodejs \
libpq-dev \
libvips42 \
Expand All @@ -42,7 +42,7 @@ USER geodata
WORKDIR /opt/app

# Add binstubs to the path.
ENV PATH "/opt/app/bin:$PATH"
ENV PATH="/opt/app/bin:$PATH"


# If run with no other arguments, the image will start the rails server by
Expand Down Expand Up @@ -106,14 +106,14 @@ RUN rails assets:precompile assets:clean log:clear tmp:clear
ARG BUILD_TIMESTAMP
ARG BUILD_URL
ARG DOCKER_TAG
ARG GIT_BRANCH
ARG GIT_COMMIT
ARG GIT_URL
ARG GIT_REF_NAME
ARG GIT_SHA
ARG GIT_REPOSITORY_URL

# build arguments aren't persisted in the image, but ENV values are
ENV BUILD_TIMESTAMP="${BUILD_TIMESTAMP}"
ENV BUILD_URL="${BUILD_URL}"
ENV DOCKER_TAG="${DOCKER_TAG}"
ENV GIT_BRANCH="${GIT_BRANCH}"
ENV GIT_COMMIT="${GIT_COMMIT}"
ENV GIT_URL="${GIT_URL}"
ENV GIT_REF_NAME="${GIT_REF_NAME}"
ENV GIT_SHA="${GIT_SHA}"
ENV GIT_REPOSITORY_URL="${GIT_REPOSITORY_URL}"

0 comments on commit 406fde1

Please sign in to comment.