Skip to content

Normalize line endings and clean up Docker build inputs - #10

Open
labkey-tchad wants to merge 15 commits into
developfrom
fb_installFsDeps
Open

Normalize line endings and clean up Docker build inputs#10
labkey-tchad wants to merge 15 commits into
developfrom
fb_installFsDeps

Conversation

@labkey-tchad

Copy link
Copy Markdown
Member

Rationale

Several Dockerfiles ran dos2unix at build time to repair CRLF line endings, and the files those Dockerfiles consumed were mixed in flat alongside host-side build tooling (make, README.md), making it hard to tell which files were build inputs. This PR fixes line endings at the source via .gitattributes (removing the need for dos2unix), reorganizes build inputs into a consistent files/ subdirectory per image, and removes dead/unused files and images found along the way.

Related Pull Requests

  • N/A

Changes

  • Add .gitattributes eol=lf rule (generalized to **/files/**) so build-input files always check out with LF, regardless of the checkout machine's core.autocrlf.
  • Remove the now-redundant dos2unix RUN steps (and unused packages) from rsandbox, rsandbox-ver, rstudio, rstudio-base, and rstudio-singleuser Dockerfiles.
  • Move each Dockerfile's build-input files (install.R, conf, Rprofile.site, cleanupSessionFiles.sh, entrypoint, etc.) into a files/ subdirectory, separate from make/Makefile/README.md, updating COPY paths accordingly.
  • Remove unused rstudio-base/init and rstudio-base/rstudio-singleuser — dead files never referenced by any Dockerfile.
  • Remove the rstudio-singleuser and rsandbox-ver images.
  • Bump base image versions to latest and add hadolint/shellcheck/yamllint validation workflows.

Pin eol=lf for files COPY'd into images as Unix scripts (install.R,
conf, Rprofile.site, cleanupSessionFiles.sh, rstudio-singleuser) so a
fresh checkout is always correct, then remove the now-redundant
dos2unix steps (and unused packages) from the affected Dockerfiles.
Separate files a Dockerfile COPYs into the image from host-side build
tooling (make, README) by moving the former into a files/
subdirectory per image and updating COPY paths. Build context is
unchanged.
Neither file has ever been referenced by any Dockerfile.
Also drop the now-dead rstudio-singleuser eol=lf rule from
.gitattributes.
Now that Dockerfile build inputs consistently live under a files/
subdirectory per image, one path pattern covers them instead of an
enumerated filename list, so new files added there are covered
automatically.
Add images/labkey/Makefile with a target per R image (r, rsandbox,
rstudio-base, rstudio). rsandbox, rstudio-base, and rstudio share a
single R_VERSION variable (the R/RStudio version); r's Dockerfile pins
its own Ubuntu base version, so it takes no version argument. rstudio
depends on rstudio-base like the old scripts' pushd/popd did. Remove
the now-redundant make and make.bat scripts and update
rsandbox/README.md's build instructions accordingly.
Leftover from the pre-Makefile build scripts; superseded by
images/labkey/Makefile.
The single 'dockerfile: Dockerfile' step only linted a root-level
Dockerfile that doesn't exist in this repo. Add recursive: true so it
finds every file named Dockerfile anywhere in the tree (recursive mode
globs on the literal filename, so it won't catch Dockerfile.echo), and
add a second explicit step for python/nbconvert/Dockerfile.echo.
r/Dockerfile:
- Consolidate the three apt-get RUN instructions into one (DL3059)
  and clean up /var/lib/apt/lists afterward (DL3009).
- Add --no-install-recommends to the r-cran-* install (DL3015).
- Fix 'ln -fs .../America/Los_Angeles/etc/localtime' — a missing
  space glued the source and destination into one argument, so ln
  was silently linking into the wrong place (SC2226).

rstudio-base/Dockerfile:
- Set SHELL with -o pipefail so the piped 'R --version | grep' RUN
  fails loudly on error instead of masking it (DL4006).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant