-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Docker step less redundant #9
Comments
Should also upgrade the action. This step may help: |
Related issue: Though their solution didn't help in my case:
Nor did mounting volumes in the matrix config:
Still getting the same error:
|
Tried many variations of this, all of them ran into the same error regarding being unable to find Docker executable. @almahmoud do you have any insights for how to overcome these issues on GHA? #### Docker registry steps ####
- name: 🐳🛠 Set up Docker Buildx
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
uses: docker/setup-buildx-action@v3
- name: 🐳🛠 Set up QEMU
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: 🐳🔐 Log in to the Github Container registry - ghcr.io
if : |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'ghcr.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ inputs.GITHUB_TOKEN }}
- name: 🐳🔐 Log in to the Github Container registry - docker.io
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'docker.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.docker_user }}
password: ${{ inputs.DOCKER_TOKEN }}
- name: 🐳✏️ Create Docker file
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
run: |
options(crayon.enabled = TRUE)
if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows")
path <- rworkflows::use_dockerfile()
shell: Rscript {0}
- name: 🐳🚀 Build and push to Docker registry
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
uses: docker/build-push-action@v5
with:
push: true
tags: |
${{ inputs.docker_registry }}/${{ inputs.docker_org }}/${{ env.packageName }}:${{ env.packageVersion }},
${{ inputs.docker_registry }}/${{ inputs.docker_org }}/${{ env.packageName }}:latest
build_args: |
PKG=${{ env.packageNameOrig }},
BASE_IMAGE=${{ matrix.config.cont }} |
Can you clarify what you're trying to do?
I'm assuming GHA automatically mount the docker sockets for docker in docker to work but if they don't, you might need that too |
thanks, @almahmoud! Here is the premise of the issue:
I'm not sure if I explained that very well, so if it's not clear let me know and I'd be happy to explain my thought process a bit better on a call. |
A suggestion that came up in the most recent Bioc Cloud Methods WG meeting: Add the |
The context of the the COPY there, is that we run through an arbitrary number of steps in the build stage, then essentially restart from the base image and copy the entirety of the contents from the end of the build stage into the base image, resulting in a single layer for the diff between the base and built image, essentially squashing all Bioconductor additions into a single layer over the rocker base image. More generally, some hopefully helpful pointers:
|
Currently, I build the Docker container twice (once in the beginning of the Linux workflow, and again via the
docker/build-push-action@v1
step. Would be more efficient to just push the first one.The text was updated successfully, but these errors were encountered: