question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error setup-buildx-action does not find docker

See original GitHub issue

Behaviour

I am trying to push a docker image to to dockerhub using github actions with setup-buildx-action but I get a very strange error:

image

The issue corresponds to this part of the .yaml file:

      - name: Set up Docker Buildx        
      - uses: docker/setup-buildx-action@v1

Steps to reproduce this issue

  1. Use my .yaml file provided below
  2. Run with any github repo, mine was an R package which ran a CRAN check beforehand
  3. I’ve also included the Dockerfile I was using

Expected behaviour

I expect the Set Up Docker Buildx to find the Dockerfile

Actual behaviour

It doesn’t seem to

Configuration

  • Private Repo but Dockerfile and .yaml file provided
AT END WITH DOCKERFILE

Logs

Attached zipped logfile for github action run logs_10.zip

.yaml file

name: R GitHub Actions

on:
  push:
    branches:
      - main
      - master
      - dev-am
  pull_request:
    branches:
      - main
      - master

jobs:
  R-CMD-check:
    name: R-CMD-check
    runs-on: ubuntu-latest
    container: almurphy/scfdev:latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      RGL_USE_NULL: TRUE
    steps:
      - uses: actions/checkout@v2
      - name: Setup R
        uses: r-lib/actions/setup-r@v1
        with:
          install-r: false

      - name: Install dependencies
        run: |
          install.packages(c("remotes", "rcmdcheck"))
          remotes::install_deps(dependencies = TRUE)
        shell: Rscript {0}
      - name: Check
        run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
        shell: Rscript {0}
        
      - name: Get R package version
        run: |
          version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+")
          echo "packageVersion=${version}" >> $GITHUB_ENV
        shell: bash {0}
        
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: ${{ github.repository}}:${{ env.packageVersion }}

Dockerfile

#LABEL maintainer="Combiz Khozoie, Ph.D. c.khozoie@imperial.ac.uk, Alan Murphy, a.murphy@imperial.ac.uk"

## Use rstudio installs binaries from RStudio's RSPM service by default, 
## Uses the latest stable ubuntu, R and Bioconductor versions. Created on unbuntu 20.04, R 4.0 and BiocManager 3.12
FROM rocker/rstudio


## Add packages dependencies
RUN apt-get update \
	&& apt-get install -y --no-install-recommends apt-utils \
	&& apt-get install -y --no-install-recommends \
	## Basic deps
	gdb \
	libxml2-dev \
	python3-pip \
	libz-dev \
	liblzma-dev \
	libbz2-dev \
	libpng-dev \
	libgit2-dev \
	## sys deps from bioc_full
	pkg-config \
	fortran77-compiler \
	byacc \
	automake \
	curl \
	## This section installs libraries
	libpcre2-dev \
	libnetcdf-dev \
	libhdf5-serial-dev \
	libfftw3-dev \
	libopenbabel-dev \
	libopenmpi-dev \
	libxt-dev \
	libudunits2-dev \
	libgeos-dev \
	libproj-dev \
	libcairo2-dev \
	libtiff5-dev \
	libreadline-dev \
	libgsl0-dev \
	libgslcblas0 \
	libgtk2.0-dev \
	libgl1-mesa-dev \
	libglu1-mesa-dev \
	libgmp3-dev \
	libhdf5-dev \
	libncurses-dev \
	libbz2-dev \
	libxpm-dev \
	liblapack-dev \
	libv8-dev \
	libgtkmm-2.4-dev \
	libmpfr-dev \
	libmodule-build-perl \
	libapparmor-dev \
	libprotoc-dev \
	librdf0-dev \
	libmagick++-dev \
	libsasl2-dev \
	libpoppler-cpp-dev \
	libprotobuf-dev \
	libpq-dev \
	libperl-dev \
	## software - perl extentions and modules
	libarchive-extract-perl \
	libfile-copy-recursive-perl \
	libcgi-pm-perl \
	libdbi-perl \
	libdbd-mysql-perl \
	libxml-simple-perl \
	libmysqlclient-dev \
	default-libmysqlclient-dev \
	libgdal-dev \
	## new libs
	libglpk-dev \
	## Databases and other software
	sqlite \
	openmpi-bin \
	mpi-default-bin \
	openmpi-common \
	openmpi-doc \
	tcl8.6-dev \
	tk-dev \
	default-jdk \
	imagemagick \
	tabix \
	ggobi \
	graphviz \
	protobuf-compiler \
	jags \
	## Additional resources
	xfonts-100dpi \
	xfonts-75dpi \
	biber \
	libsbml5-dev \
	&& apt-get clean \
	&& rm -rf /var/lib/apt/lists/*

RUN install2.r -e \
testthat \
covr \
knitr \
purrr \
stringr \
cli \
dplyr \
data.table \
R.utils \
vroom \
ggpubr \
ggplot2 \
rmarkdown \
rlang \
future \
future.apply \
plotly \
threejs \
plyr \
assertthat \
httr \
prettydoc \
leaflet \
gdtools \
formattable \
ggdendro \
ggridges \
cowplot \
forcats \
ggrepel \
igraph \
tibble \
tidyr \
tidyselect \
tidyverse \
ids \
snow \
remotes \
rliger \
argparse \
Hmisc

## Install remaining packages from source
COPY ./misc/requirements-src.R .
RUN Rscript requirements-src.R

## Install Bioconductor packages
COPY ./misc/requirements-bioc.R .
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
   libfftw3-dev \
   gcc && apt-get clean \
 && rm -rf /var/lib/apt/lists/*
RUN Rscript -e 'requireNamespace("BiocManager"); BiocManager::install(ask=F);' \
&& Rscript requirements-bioc.R

## Install from GH the following
RUN installGithub.r neurogenomics/EWCE \
chris-mcginnis-ucsf/DoubletFinder \
theislab/kBET \
combiz/RANN.L1 \
NathanSkene/One2One \
hhoeflin/hdf5r \
mojaveazure/loomR \
cole-trapnell-lab/monocle3 \
neurogenomics/scFlowExample \
neurogenomics/scFlowData

## Install scFlow package
# Copy description
WORKDIR scFlow
ADD . .

# Install R package from source
RUN Rscript -e "remotes::install_local()"
RUN rm -rf *

## Check if scFlow installed
#RUN R -e 'library(scFlow)'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crazy-maxcommented, Jun 8, 2021

If you want a simple workflow to build your Dockerfile, the following should work:

name: R GitHub Actions

on:
  push:
    branches:
      - main
      - master
      - dev-am
  pull_request:
    branches:
      - main
      - master

jobs:
  R-CMD-check:
    runs-on: ubuntu-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      RGL_USE_NULL: TRUE
    steps:
      - uses: actions/checkout@v2
      - name: Setup R
        uses: r-lib/actions/setup-r@v1
        with:
          install-r: false
      - name: Install dependencies
        run: |
          install.packages(c("remotes", "rcmdcheck"))
          remotes::install_deps(dependencies = TRUE)
        shell: Rscript {0}
      - name: Check
        run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
        shell: Rscript {0}
      - name: Get R package version
        run: |
          version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+")
          echo "packageVersion=${version}" >> $GITHUB_ENV
        shell: bash {0}
      - name: Login to DockerHub
        uses: docker/login-action@v1
        if: github.event_name != 'pull_request'
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          push: ${{ github.event_name != 'pull_request' }}
          tags: almurphy/scfdev:${{ env.packageVersion }}

What I’ve changed:

  • tags: ${{ github.repository}}:${{ env.packageVersion }}: not sure you want to push on ${{ github.repository}} but almurphy/scfdev on Docker Hub? I guess?
  • if: github.event_name != 'pull_request': Don’t login on pull request because secrets are not available.
  • push: ${{ github.event_name != 'pull_request' }}: Don’t push on pull request because secrets are not available.
0reactions
Al-Murphycommented, Jun 8, 2021

It’s more so I want to build an image, run the R CMD Check on that image to ensure it is working properly and then push to dockerhub if the check passes. I have posted a question on stack overflow (https://stackoverflow.com/questions/67886275/github-actions-build-docker-image-run-r-cmd-check-push-to-dockerhub) so hopefully someone will be able to help! Thanks very much for your time on this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'buildx' is not a docker command · Issue #33 - GitHub
Now i'm having problem with docker buildx, [error]docker: 'buildx' is not a docker command Configuration Repository URL (if public): Build ...
Read more >
Using Github Action to build Docker image with ASP.Net ...
I need to build a Docker image for Windows platform containing an ASP.Net Framework 4.8 application using Github Action.
Read more >
Configuring your builder - Docker Documentation
Configuring your builder. This page contains instructions on configuring your BuildKit instances when using our Setup Buildx Action.
Read more >
Update App Platform to user Github action and Docker
I am now getting errors in the build 'could not detect app files that ... docker/setup-buildx-action@v2 - name: Login to DockerHub uses: ...
Read more >
Build images on GitHub Actions with Docker layer caching
Sadly, what the documentation does not mention is that there exists a very simple way to set up a buildx/BuildKit runner in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found