Skip to content

Commit

Permalink
๐Ÿ™€ chore: dockerfile FROM base image ๊ฒฝ๋กœ๋ฅผ ์ง์ ‘์ ์œผ๋กœ ์ž…๋ ฅํ•˜๋Š” ๋ฒ„์ „
Browse files Browse the repository at this point in the history
  • Loading branch information
Honghyeonji committed Jan 16, 2025
1 parent d671848 commit 3630fda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/boolock-dev-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,40 +70,15 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and Save Base Image
- name: Build and Push Base Image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.base
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest,mode=max
cache-to: |
type=inline
type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest,mode=max
- name: Authenticate with Docker Hub
run: |
TOKEN=$(curl -s -u "${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_PASSWORD }}" \
"https://auth.docker.io/token?service=registry.docker.io&scope=repository:${{ secrets.DOCKERHUB_USERNAME }}/base-image:pull,push" | jq -r .token)
echo "Token: $TOKEN"
curl -H "Authorization: Bearer $TOKEN" -v https://registry-1.docker.io/v2/${{ secrets.DOCKERHUB_USERNAME }}/base-image/manifests/latest
- name: Pull Base Image (Remote)
run: docker pull docker.io/${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest

- name: Verify Base Image
run: docker images ${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest

- name: Retag Base Image Locally
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest base-image:latest

- name: Save Base Image to File
run: docker save base-image:latest -o base-image.tar

- name: Load Base Image from File
run: docker load -i base-image.tar
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/base-image:latest,mode=max

- name: Build and Push Frontend Image
uses: docker/build-push-action@v4
Expand Down
3 changes: 1 addition & 2 deletions apps/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG DOCKERHUB_USERNAME
FROM ${DOCKERHUB_USERNAME}/base-image AS frontend-build
FROM hyeonji8436/base-image AS frontend-build

WORKDIR /app/apps/client
COPY ./apps/client .
Expand Down

0 comments on commit 3630fda

Please sign in to comment.