Skip to content
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

Set default UTF-8 locale #18

Merged
merged 5 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions 3.1/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.1/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.2/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.2/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.3/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.3/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.4/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.4/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.5/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions 3.5/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
6 changes: 0 additions & 6 deletions Dockerfile-ubuntu.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,4 @@ RUN wget -O R-${R_VERSION}.tar.gz https://cdn.rstudio.com/r/${OS_IDENTIFIER}/R-$
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}.tar.gz

# Set default locale
RUN update-locale --reset LANG=C.UTF-8

# Set default LANG via Renviron.site
RUN echo "LANG=C.UTF-8" >> /usr/lib/R/etc/Renviron.site

CMD ["R"]
5 changes: 4 additions & 1 deletion base/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ RUN mkdir -p /opt/pandoc && \
wget -O /opt/pandoc/pandoc-citeproc.gz https://files.r-hub.io/pandoc/linux-64/pandoc-citeproc.gz && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG C.UTF-8
3 changes: 3 additions & 0 deletions base/centos6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ RUN mkdir -p /opt/pandoc && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG en_US.UTF-8
3 changes: 3 additions & 0 deletions base/centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ RUN mkdir -p /opt/pandoc && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG en_US.UTF-8
3 changes: 3 additions & 0 deletions base/opensuse15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ RUN mkdir -p /opt/pandoc && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG C.UTF-8
3 changes: 3 additions & 0 deletions base/opensuse42/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ RUN mkdir -p /opt/pandoc && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG C.UTF-8
5 changes: 4 additions & 1 deletion base/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ RUN mkdir -p /opt/pandoc && \
wget -O /opt/pandoc/pandoc-citeproc.gz https://files.r-hub.io/pandoc/linux-64/pandoc-citeproc.gz && \
gzip -d /opt/pandoc/pandoc-citeproc.gz && \
chmod +x /opt/pandoc/pandoc-citeproc && \
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc
ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc

# Set default locale
ENV LANG C.UTF-8
6 changes: 6 additions & 0 deletions test/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ if (length(OlsonNames()) == 0) {
stop("Time zone database not found")
}

# Check that we're in a UTF-8 native locale (e.g. LANG=C.UTF-8 or LANG=en_US.UTF-8)
# https://stat.ethz.ch/R-manual/R-devel/library/base/html/locales.html
if (!l10n_info()[["UTF-8"]]) {
stop("not in a UTF-8 native locale")
}

# Check that built-in packages can be loaded
for (pkg in rownames(installed.packages(priority = c("base", "recommended")))) {
if (!require(pkg, character.only = TRUE)) {
Expand Down
1 change: 1 addition & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -ex
DIR="$(dirname "$(readlink -f "$BASH_SOURCE")")"

R --version
Rscript -e 'sessionInfo()'

# R devel dependencies
gcc --version
Expand Down