Skip to content

Commit

Permalink
fix s6-overlay overwriting bin symlinks:
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 3, 2022
1 parent 6e02e4d commit ca77722
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,17 @@ windows/amd64:
@echo "building collector binary (OS = $(OS), ARCH = $(ARCH))"
xgo -v --targets="$(OS)/$(ARCH)" -ldflags "-extldflags=-static -X main.goos=$(OS) -X main.goarch=$(ARCH)" -out scrutiny-collector-metrics -tags "static netgo" ${GO_WORKSPACE}/collector/cmd/collector-metrics/


docker-collector:
@echo "building collector docker image"
docker build --build-arg TARGETARCH=amd64 -f docker/Dockerfile.collector -t analogj/scrutiny-dev:collector .

docker-web:
@echo "building web docker image"
docker build --build-arg TARGETARCH=amd64 -f docker/Dockerfile.web -t analogj/scrutiny-dev:web .

docker-omnibus:
@echo "building omnibus docker image"
docker build --build-arg TARGETARCH=amd64 -f docker/Dockerfile -t analogj/scrutiny-dev:omnibus .
# clean:
# rm scrutiny-collector-metrics-* scrutiny-web-*
9 changes: 4 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,18 @@ WORKDIR /opt/scrutiny
ENV PATH="/opt/scrutiny/bin:${PATH}"
ENV INFLUXD_CONFIG_PATH=/opt/scrutiny/influxdb

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y cron smartmontools ca-certificates curl tzdata \
&& update-ca-certificates \
&& case ${TARGETARCH} in \
"amd64") S6_ARCH=amd64 ;; \
"arm64") S6_ARCH=aarch64 ;; \
esac \
&& curl https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-${S6_ARCH}.tar.gz -L -s --output /tmp/s6-overlay-${S6_ARCH}.tar.gz \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin \
&& rm -rf /tmp/s6-overlay-${S6_ARCH}.tar.gz \
&& curl https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-${TARGETARCH}.deb -L -s --output /tmp/influxdb2-2.2.0-${TARGETARCH}.deb \
&& dpkg -i --force-all /tmp/influxdb2-2.2.0-${TARGETARCH}.deb || true \
&& rm -rf /tmp/influxdb2-2.2.0-${TARGETARCH}.deb
&& curl -L https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-${TARGETARCH}.deb --output /tmp/influxdb2-2.2.0-${TARGETARCH}.deb \
&& dpkg -i --force-all /tmp/influxdb2-2.2.0-${TARGETARCH}.deb

COPY /rootfs /

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.collector
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN go mod vendor && \
FROM ubuntu:latest as runtime
WORKDIR /scrutiny
ENV PATH="/opt/scrutiny/bin:${PATH}"
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y cron smartmontools ca-certificates tzdata && update-ca-certificates

COPY /docker/entrypoint-collector.sh /entrypoint-collector.sh
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FROM ubuntu:latest as runtime
EXPOSE 8080
WORKDIR /opt/scrutiny
ENV PATH="/opt/scrutiny/bin:${PATH}"
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y ca-certificates curl tzdata && update-ca-certificates

COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny /opt/scrutiny/bin/
Expand Down

0 comments on commit ca77722

Please sign in to comment.