Using a large base image for now
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Martin Slot 2023-01-29 11:01:51 +01:00
parent 98a58bdb7f
commit b3a481762f
3 changed files with 20 additions and 20 deletions

View File

@ -1,10 +1,10 @@
#pipeline:
# build_api:
# image: docker:20.10.23
# commands:
# - docker login $GIT_URI -p $GIT_PASS -u $GIT_USER
# - DOCKER_BUILDKIT=1 docker build -t ferris:$CI_BUILD_NUMBER -t $GIT_URI/mslot/ferris:$CI_BUILD_NUMBER .
# - docker push $GIT_URI/mslot/ferris:$CI_BUILD_NUMBER
# secrets: [ git_uri, git_pass, git_user ]
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
pipeline:
build_api:
image: docker:20.10.23
commands:
- docker login $GIT_URI -p $GIT_PASS -u $GIT_USER
- DOCKER_BUILDKIT=1 docker build -t ferris:$CI_BUILD_NUMBER -t ferris:latest -t $GIT_URI/mslot/ferris:$CI_BUILD_NUMBER -t $GIT_URI/mslot/ferris:latest .
- docker push $GIT_URI/mslot/ferris:$CI_BUILD_NUMBER
secrets: [ git_uri, git_pass, git_user ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock

View File

@ -1,14 +1,11 @@
FROM alpine:latest AS builder
RUN wget https://github.com/thedodd/trunk/releases/download/v0.16.0/trunk-x86_64-unknown-linux-gnu.tar.gz
RUN tar -xvf trunk-x86_64-unknown-linux-gnu.tar.gz
RUN chown root:root trunk
RUN ls -la
FROM rust:slim AS builder
RUN apt update && apt install pkg-config libssl-dev -y && rm -rf /var/lib/apt/lists/*
FROM alpine:latest AS final
RUN cargo install --locked trunk
RUN cargo install --locked wasm-bindgen-cli
RUN rustup target add wasm32-unknown-unknown
COPY --from=builder /trunk /bin/trunk
RUN chmod +x /bin/trunk
WORKDIR /source
CMD ["build", "--release"]
ENTRYPOINT ["/bin/trunk"]
ENTRYPOINT ["trunk"]

View File

@ -8,4 +8,7 @@ You can run it like this
docker run --rm -v /root/folder/of/website:/source ferris:v1
```
it will build it in release mode pr default.
it will build it in release mode pr default.
# Size
This image is large, but i have no idea how to boil it down because it needs cargo, trunk, wasm32-unknown-unknown etc. This suits my preferences just fine now: i have my own build server that resides on the same machine as the docker registry. Maybe it can be optimized by using a slim alpine image? If you have any ideas, please let me know.