Skip to content

Commit

Permalink
build: enable building multi-platform images
Browse files Browse the repository at this point in the history
  • Loading branch information
kyagi committed May 14, 2023
1 parent a6ad0f0 commit b5bf448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM rust:1.67 as builder
FROM --platform=$BUILDPLATFORM rust:1.67 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
WORKDIR app
COPY . .
RUN cargo install --path .
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ $ cd ec5

3. Build the customized image and run it.
```
➜ docker buildx build --platform linux/amd64 -t ec5:customized .
➜ # or
➜ docker buildx build --platform linux/arm64 -t ec5:customized .
➜ docker image build -t ec5:customized .
➜ docker run --rm -p 8000:8000 --name ec5-customized -it ec5:customized
```

Expand Down

0 comments on commit b5bf448

Please sign in to comment.