Closed ChinmoyPadhi closed 2 years ago
@AKhares: I tried to run the above command but its still failing. I made a small change instead of libswitch-perl
which is from Debian
package, I modified that to perl-switch
which is from alpine
package, it does got executed but getting the following error mv: can't rename '/root/.TinyTeX': No such file or directory
also does this path https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh
present in github any longer
$ docker build -t reporter-2.3.1 .
Sending build context to Docker daemon 18.48MB
Step 1/10 : FROM golang:1.14.7-alpine3.12 AS build
---> cf2ff089aa2c
Step 2/10 : WORKDIR /go/src/${owner:-github.com/IzakMarais}/reporter
---> Using cache
---> 24f0b0484f4c
Step 3/10 : RUN apk update && apk add make git
---> Using cache
---> 3c182e883948
Step 4/10 : ADD . .
---> e7f8399b7ea9
Step 5/10 : RUN make build
---> Running in bbf7fe28be76
go install -v github.com/IzakMarais/reporter/cmd/grafana-reporter
github.com/IzakMarais/reporter/vendor/github.com/pborman/uuid
github.com/IzakMarais/reporter/grafana
github.com/IzakMarais/reporter/vendor/github.com/gorilla/mux
github.com/IzakMarais/reporter/report
github.com/IzakMarais/reporter/cmd/grafana-reporter
Removing intermediate container bbf7fe28be76
---> c76a5ebf76d4
Step 6/10 : FROM alpine:3.12
---> 24c8ece58a1a
Step 7/10 : COPY util/texlive.profile /
---> Using cache
---> 1fa92e50509f
Step 8/10 : RUN PACKAGES="wget perl-switch" && apk update && apk add $PACKAGES && apk add ca-certificates && wget -qO- "https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | sh -s - --admin --no-path && mv ~/.TinyTeX /opt/TinyTeX && /opt/TinyTeX/bin/*/tlmgr path add && tlmgr path add && chown -R root:adm /opt/TinyTeX && chmod -R g+w /opt/TinyTeX && chmod -R g+wx /opt/TinyTeX/bin && tlmgr install epstopdf-pkg && apk del --purge -qq $PACKAGES && apk del --purge -qq && rm -rf /var/lib/apt/lists/*
---> Running in 9198cb7aec09
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
v3.12.12-12-ge5a8c3fe70 [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
v3.12.10-17-g0c8862530f [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
OK: 12763 distinct packages available
(1/6) Installing libbz2 (1.0.8-r1)
(2/6) Installing perl (5.30.3-r0)
(3/6) Installing perl-switch (2.17-r1)
(4/6) Installing libunistring (0.9.10-r0)
(5/6) Installing libidn2 (2.3.0-r0)
(6/6) Installing wget (1.20.3-r1)
Executing busybox-1.31.1-r22.trigger
OK: 45 MiB in 20 packages
(1/1) Installing ca-certificates (20211220-r0)
Executing busybox-1.31.1-r22.trigger
Executing ca-certificates-20211220-r0.trigger
OK: 45 MiB in 21 packages
mv: can't rename '/root/.TinyTeX': No such file or directory
The command '/bin/sh -c PACKAGES="wget perl-switch" && apk update && apk add $PACKAGES && apk add ca-certificates && wget -qO- "https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | sh -s - --admin --no-path && mv ~/.TinyTeX /opt/TinyTeX && /opt/TinyTeX/bin/*/tlmgr path add && tlmgr path add && chown -R root:adm /opt/TinyTeX && chmod -R g+w /opt/TinyTeX && chmod -R g+wx /opt/TinyTeX/bin && tlmgr install epstopdf-pkg && apk del --purge -qq $PACKAGES && apk del --purge -qq && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1
Please help me to resolve the above issue
The Dockerfile has been updated to build the image, I have added perl-switch
, fontconfig
alpine packages and also the github url has been updated to https://raw.githubusercontent.com/yihui/tinytex/main/tools/install-unx.sh
. after these changes I'm able to build the image
# build
FROM golang:1.14.7-alpine3.12 AS build
WORKDIR /go/src/${owner:-github.com/IzakMarais}/reporter
RUN apk update && apk add make git
ADD . .
RUN make build
# create image
FROM alpine:3.12
COPY util/texlive.profile /
RUN PACKAGES="wget perl-switch" \
&& apk update \
&& apk add $PACKAGES \
&& apk add fontconfig \
&& apk add ca-certificates \
&& wget -qO- \
"https://raw.githubusercontent.com/yihui/tinytex/main/tools/install-unx.sh" | \
sh -s - --admin --no-path \
&& mv ~/.TinyTeX /opt/TinyTeX \
&& /opt/TinyTeX/bin/*/tlmgr path add \
&& tlmgr path add \
&& chown -R root:adm /opt/TinyTeX \
&& chmod -R g+w /opt/TinyTeX \
&& chmod -R g+wx /opt/TinyTeX/bin \
&& tlmgr install epstopdf-pkg \
# Cleanup
&& apk del --purge -qq $PACKAGES \
&& apk del --purge -qq \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /go/bin/grafana-reporter /usr/local/bin
ENTRYPOINT [ "/usr/local/bin/grafana-reporter" ]
Thanks @ChinmoyPadhi for looking into it. Can you please raise a PR to @IzakMarais and get it merged.
Verified! it's working for me. Thanks!!!. I see this repo has no movement. Still, it would be nice to have to contribution added.
Hi, I'm trying to build image using Dockerfile in my VM. Following error I encountered:
Please suggest how this error can be resolved.