Skip to content

Commit

Permalink
fix: Build images with race. WIP create 2 types of images, one with r…
Browse files Browse the repository at this point in the history
…ace other without
  • Loading branch information
Matovidlo committed Nov 28, 2024
1 parent 0908146 commit 6488153
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ run-templates-api:
build-stream-service:
CGO_ENABLED=0 go build -v -mod mod -ldflags "-s -w" -o "$(or $(BUILD_TARGET_PATH), ./target/stream/service)" ./cmd/stream

build-stream-service-with-race:
CGO_ENABLED=1 go build -race -v -mod mod -ldflags "-s -w" -o "$(or $(BUILD_TARGET_PATH), ./target/stream/service)" ./cmd/stream

run-stream-service:
rm -rf /tmp/stream-volumes && \
mkdir -p /tmp/stream-volumes/hdd/my-volume && \
air -c ./provisioning/stream/dev/.air.toml

run-stream-service-once: build-stream-service
run-stream-service-once: build-stream-service-with-race
./target/stream/service api http-source storage-writer storage-reader storage-coordinator

build-apps-proxy:
Expand Down
2 changes: 1 addition & 1 deletion provisioning/apps-proxy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY . .
RUN make build-apps-proxy

# Production container
FROM alpine:3.19
FROM alpine:3.20
RUN apk add -U --no-cache ca-certificates git

COPY --from=buildContainer /app/target/apps-proxy/proxy /app/server
Expand Down
1 change: 1 addition & 0 deletions provisioning/dev/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ COPY Makefile /tmp/build/Makefile
COPY scripts /tmp/build/scripts
RUN cd /tmp/build && make tools && cd / && rm -rf /tmp/build && go clean -cache -modcache
RUN apt update && apt install -y graphviz
RUN apt-get install --no-install-recommends --assume-yes build-essential libsqlite3-0

# Install envsubstr and helm
RUN curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-$(uname -s)-$(uname -m) -o /usr/local/bin/envsubst && \
Expand Down
3 changes: 2 additions & 1 deletion provisioning/stream/docker/service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build container
FROM golang:1.23.3-alpine3.20 AS buildContainer
RUN apk add -U --no-cache bash make curl
RUN apk add --no-cache --update gcc g++
WORKDIR /app

COPY Makefile Makefile
Expand All @@ -15,7 +16,7 @@ COPY . .
RUN make build-stream-service

# Production container
FROM alpine:3.19
FROM alpine:3.20
RUN apk add -U --no-cache ca-certificates git

COPY --from=buildContainer /app/target/stream/service /app/service
Expand Down
2 changes: 1 addition & 1 deletion provisioning/templates-api/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY . .
RUN make build-templates-api

# Production container
FROM alpine:3.19
FROM alpine:3.20
RUN apk add -U --no-cache ca-certificates git

COPY --from=buildContainer /app/target/templates/api /app/server
Expand Down

0 comments on commit 6488153

Please sign in to comment.