File tree 3 files changed +35
-1
lines changed
3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,8 @@ wasm-client.wasm
19
19
# Mobile build output
20
20
build /
21
21
22
+ # Reproducible build output
23
+ reproducible-builds /
24
+
22
25
# Misc
23
26
* .DS_Store
Original file line number Diff line number Diff line change
1
+ #Get golang 1.17.3-buster as a base image
2
+ FROM golang:1.17.3-buster@sha256:ee3a388a872237ddb600de3ab9512e73df0043f8878f0f355baeb5b723ef16ec as builder
3
+
4
+ #Define the working directory in the container
5
+ WORKDIR /app
6
+
7
+ #Copy all files from root into the container
8
+ COPY . ./
9
+
10
+ #Use go mod tidy to handle dependencies
11
+ RUN go mod tidy
12
+
13
+ #Run the make task
14
+ RUN make wasm
Original file line number Diff line number Diff line change 66
66
wasm :
67
67
# The appengine build tag is needed because of the jessevdk/go-flags library
68
68
# that has some OS specific terminal code that doesn't compile to WASM.
69
- cd cmd/wasm-client; GOOS=js GOARCH=wasm go build -trimpath -ldflags=" $( LDFLAGS) " -tags=" $( RPC_TAGS) " -v -o wasm-client.wasm .
69
+ cd cmd/wasm-client; CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -trimpath -ldflags=" $( LDFLAGS) " -tags=" $( RPC_TAGS) " -v -o wasm-client.wasm .
70
70
$(CP ) cmd/wasm-client/wasm-client.wasm example/wasm-client.wasm
71
71
72
72
apple :
@@ -91,6 +91,23 @@ android:
91
91
92
92
mobile : ios android
93
93
94
+ repro-wasm :
95
+ # Build the repro-wasm image
96
+ docker build -f Dockerfile-wasm -t repro-wasm-image --no-cache .
97
+
98
+ # Run the repro-wasm-image in a new container called repro-wasm
99
+ docker run --name repro-wasm repro-wasm-image
100
+
101
+ # Copy the compiled WASM file to the host machine
102
+ mkdir -p reproducible-builds
103
+ docker cp repro-wasm:/app/cmd/wasm-client/wasm-client.wasm ./reproducible-builds/
104
+
105
+ # Remove the repro-wasm container
106
+ docker rm repro-wasm
107
+
108
+ # Remove the repro-wasm-image
109
+ docker image rm repro-wasm-image
110
+
94
111
# =======
95
112
# TESTING
96
113
# =======
You can’t perform that action at this time.
0 commit comments