Skip to content

Commit

Permalink
Merge pull request #15 from sonia-auv/feature/fix_docker_image
Browse files Browse the repository at this point in the history
Feature/fix docker image
  • Loading branch information
LogSonia authored Mar 23, 2024
2 parents 6c5748e + 0ff7240 commit 1a2c608
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker-image-perception-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
TARGET_VERSION: develop
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the docker image (perception based)
run: |
docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
Expand All @@ -37,17 +37,17 @@ jobs:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
TARGET_VERSION: develop
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker-image-perception-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the docker image (perception based)
run: |
docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
Expand All @@ -33,17 +33,17 @@ jobs:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker-image-perception-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set Target version
run: echo "TARGET_VERSION=release-$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)" >> $GITHUB_ENV

Expand All @@ -41,16 +41,16 @@ jobs:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
BASE_IMAGE: "ghcr.io/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
GITHUB_REMOTE_URL: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set Target version
run: echo "TARGET_VERSION=release-$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)" >> $GITHUB_ENV
- name: Install QEMU to be able to compile on X86 into ARM64
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM "ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARG BASE_IMAGE="ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest"

FROM ${BASE_IMAGE}

USER root

Expand Down

0 comments on commit 1a2c608

Please sign in to comment.