Skip to content

Commit e227db2

Browse files
committed
Update:
* Fix base64 decode for circle ci * Add readme
1 parent 6709236 commit e227db2

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
name: Build and push Docker image
1414
command: |
1515
docker build -t opengg/rust-wasm .
16-
echo "$DOCKER_PASSWORD_BASE64"|base64 --decode|docker login -u "$DOCKER_USER" --password-stdin
16+
echo "$DOCKER_PASSWORD_BASE64"|base64 -d|docker login -u "$DOCKER_USER" --password-stdin
1717
docker push opengg/rust-wasm
1818

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# docker-rust-wasm
22
Minimal docker image for rust to wasm compilation
3+
4+
Based on [Compiling Rust to Wasm manually with the LLVM wasm-backend (without Emscripten)](https://gist.github.com/LukasKalbertodt/821ab8b85a25f4c54544cc43bed2c39f)
5+
6+
## Usage
7+
8+
First, prepare your rust source file, e.g. `add.rs`.
9+
10+
```rust
11+
#[no_mangle]
12+
pub fn add_twenty_seven(n: i32) -> i32 {
13+
n + 27
14+
}
15+
```
16+
17+
Then run this docker image, compiling rust into wasm.
18+
19+
```bash
20+
docker run -it --rm -v "$(pwd):/work" opengg/rust-wasm add.rs
21+
```
22+
23+
## Run an interactive shell
24+
25+
Alternatively, you can run an interactive shell, exploring
26+
this docker image freely.
27+
28+
```bash
29+
docker run -it --rm -v "$(pwd):/work" --entrypoint bash opengg/rust-wasm
30+
```

0 commit comments

Comments
 (0)