Skip to content

Commit 2480cf8

Browse files
committed
op-chain-ops: migrate binary
Adds a `migrate` binary as well as a dockerfile for building it. This `Dockerfile` should be accessed from the root of the repository, similar to the other docker files for the other bedrock packages.
1 parent 87aa40d commit 2480cf8

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

op-chain-ops/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
surgery
1+
bin

op-chain-ops/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM golang:1.18.0-alpine3.15 as builder
2+
3+
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
4+
5+
COPY ./op-chain-ops/docker.go.work /app/go.work
6+
COPY ./op-chain-ops /app/op-chain-ops
7+
COPY ./op-bindings /app/op-bindings
8+
9+
WORKDIR /app/op-chain-ops
10+
11+
RUN make migrate
12+
13+
FROM alpine:3.15
14+
15+
COPY --from=builder /app/op-chain-ops/bin/migrate /usr/local/bin
16+
17+
ENTRYPOINT ["migrate"]

op-chain-ops/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
surgery:
2-
go build -o ./surgery ./cmd/surgery/main.go
1+
migrate:
2+
go build -o ./bin/migrate ./cmd/migrate/main.go
33

44
test:
55
go test ./...
66

7-
.PHONY: surgery test
7+
.PHONY: migrate test

op-chain-ops/docker.go.work

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
go 1.18
2+
3+
use (
4+
./op-bindings
5+
./op-chain-ops
6+
)

0 commit comments

Comments
 (0)