Skip to content

Commit d48f1f5

Browse files
committed
build: fixes png rendering in the docker based docker-image build.
1 parent 8d0a100 commit d48f1f5

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

Dockerfile

+13-6
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,26 @@ RUN if [ ! -z "${DEP_ENSURE}" ]; then \
1313
fi
1414

1515
COPY pkg pkg
16-
RUN go install -ldflags="-s -w" ./pkg/cmd/grafana-server && \
17-
go install -ldflags="-s -w" ./pkg/cmd/grafana-cli
16+
COPY build.go build.go
17+
COPY package.json package.json
18+
19+
RUN go run build.go build
1820

1921
# Node build container
2022
FROM node:8
2123

2224
WORKDIR /usr/src/app/
2325

2426
COPY package.json yarn.lock ./
25-
RUN yarn install --frozen-lockfile
27+
RUN yarn install --pure-lockfile --no-progress
2628

2729
COPY Gruntfile.js tsconfig.json tslint.json ./
2830
COPY public public
2931
COPY scripts scripts
3032
COPY emails emails
3133

3234
ENV NODE_ENV production
33-
RUN yarn run build
35+
RUN ./node_modules/.bin/grunt build
3436

3537
# Final container
3638
FROM debian:stretch-slim
@@ -48,6 +50,10 @@ ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi
4850

4951
WORKDIR $GF_PATHS_HOME
5052

53+
RUN apt-get update && apt-get install -qq -y libfontconfig ca-certificates && \
54+
apt-get autoremove -y && \
55+
rm -rf /var/lib/apt/lists/*
56+
5157
COPY conf ./conf
5258

5359
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
@@ -63,13 +69,14 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
6369
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" && \
6470
chmod 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS"
6571

66-
COPY --from=0 /go/bin/grafana-server /go/bin/grafana-cli ./bin/
72+
COPY --from=0 /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-server /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-cli ./bin/
6773
COPY --from=1 /usr/src/app/public ./public
6874
COPY --from=1 /usr/src/app/tools ./tools
75+
COPY tools/phantomjs/render.js ./tools/phantomjs/render.js
6976

7077
EXPOSE 3000
7178

72-
COPY ./scripts/docker/run.sh /run.sh
79+
COPY ./packaging/docker/run.sh /run.sh
7380

7481
USER grafana
7582
ENTRYPOINT [ "/run.sh" ]

packaging/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi
2323
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
2424
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
2525

26+
WORKDIR $GF_PATHS_HOME
27+
2628
RUN apt-get update && apt-get install -qq -y libfontconfig ca-certificates && \
2729
apt-get autoremove -y && \
2830
rm -rf /var/lib/apt/lists/*
@@ -47,5 +49,4 @@ EXPOSE 3000
4749
COPY ./run.sh /run.sh
4850

4951
USER grafana
50-
WORKDIR /
5152
ENTRYPOINT [ "/run.sh" ]

0 commit comments

Comments
 (0)