Last active
September 2, 2023 11:29
-
-
Save gaborcsardi/d7f7bf8294c2a01b873bf73a4ca95a37 to your computer and use it in GitHub Desktop.
Dockerfile pak example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:22.04 | |
# install R & pak, set up repos and PPM | |
RUN apt-get update && \ | |
apt-get install -y curl && \ | |
curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-$(arch)-latest.tar.gz | \ | |
tar xz -C /usr/local && \ | |
rig add release | |
# install local file with pak | |
RUN R -q -e 'path <- download.packages("magick", ".", repos = "https://cran.rstudio.com"); pak::pkg_install(path[2])' | |
RUN R -q -e 'getOption("repos")' | |
RUN R -q -e 'getOption("HTTPUserAgent")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
#7 [3/3] RUN R -q -e 'path <- download.packages("magick", ".", repos = "https://cran.rstudio.com"); pak::pkg_install(path[2])' | |
#7 0.618 > path <- download.packages("magick", ".", repos = "https://cran.rstudio.com"); pak::pkg_install(path[2]) | |
#7 1.325 trying URL 'https://cran.rstudio.com/src/contrib/magick_2.7.5.tar.gz' | |
#7 1.581 Content type 'application/x-gzip' length 4499585 bytes (4.3 MB) | |
#7 1.601 ================================================== | |
#7 1.767 downloaded 4.3 MB | |
#7 1.767 | |
#7 3.270 | |
#7 4.578 v Updated metadata database: 4.23 MB in 10 files. | |
#7 4.579 | |
#7 4.579 i Updating metadata database | |
#7 10.79 v Updating metadata database ... done | |
#7 10.79 | |
#7 11.13 | |
#7 11.14 > Will install 4 packages. | |
#7 11.17 > Will download 4 packages with unknown size. | |
#7 11.18 + Rcpp 1.0.11 [dl] | |
#7 11.18 + curl 5.0.2 [dl] + x libcurl4-openssl-dev, x libssl-dev | |
#7 11.18 + magick 2.7.5 [bld][cmp][dl] + x imagemagick, x libmagick++-dev, x gsfonts | |
#7 11.18 + magrittr 2.0.3 [dl] | |
#7 11.18 > Will install 5 system packages: | |
#7 11.18 + gsfonts - magick | |
#7 11.18 + imagemagick - magick | |
#7 11.18 + libcurl4-openssl-dev - curl | |
#7 11.18 + libmagick++-dev - magick | |
#7 11.18 + libssl-dev - curl | |
#7 11.32 i Getting 4 pkgs with unknown sizes | |
#7 11.35 v Got magick 2.7.5 (source) (4.50 MB) | |
#7 12.12 v Got magrittr 2.0.3 (x86_64-pc-linux-gnu-ubuntu-22.04) (221.09 kB) | |
#7 12.23 v Got curl 5.0.2 (x86_64-pc-linux-gnu-ubuntu-22.04) (763.07 kB) | |
#7 12.44 v Got Rcpp 1.0.11 (x86_64-pc-linux-gnu-ubuntu-22.04) (2.15 MB) | |
#7 12.48 i Installing system requirements | |
#7 12.48 i Executing `sh -c apt-get -y update` | |
#7 16.46 i Executing `sh -c apt-get -y install imagemagick libmagick++-dev gsfonts libcurl4-openssl-dev libssl-dev` | |
#7 55.34 v Installed magrittr 2.0.3 (1.1s) | |
#7 55.41 v Installed Rcpp 1.0.11 (1.1s) | |
#7 55.45 v Installed curl 5.0.2 (1.2s) | |
#7 55.46 i Building magick 2.7.5 | |
#7 135.5 v Built magick 2.7.5 (1m 18.6s) | |
#7 136.7 v Installed magick 2.7.5 (local) (1.2s) | |
#7 136.7 v 1 pkg + 3 deps: added 4, dld 4 (7.63 MB) [2m 15s] | |
#7 136.7 > | |
#7 136.8 > | |
#7 DONE 137.2s | |
[...] | |
#7 [4/5] RUN R -q -e 'getOption("repos")' | |
#7 0.639 > getOption("repos") | |
#7 0.641 P3M | |
#7 0.641 "https://packagemanager.posit.co/cran/__linux__/jammy/latest" | |
#7 0.641 CRAN | |
#7 0.641 "https://cloud.r-project.org" | |
#7 0.641 > | |
#7 0.641 > | |
#7 DONE 0.7s | |
#8 [5/5] RUN R -q -e 'getOption("HTTPUserAgent")' | |
#8 0.706 > getOption("HTTPUserAgent") | |
#8 0.707 [1] "R/4.3.1 R (4.3.1 x86_64-pc-linux-gnu x86_64 linux-gnu)" | |
#8 0.708 > | |
#8 0.708 > | |
#8 DONE 0.8s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment