Skip to content

Commit

Permalink
update tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed Jul 4, 2024
1 parent 443fd14 commit c8df158
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_push.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
}, {
"name": "build and push image",
"uses": "docker/build-push-action@v5",
"uses": "docker/build-push-action@v6",
"with": {
"push": true,
"pull": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
username: ${{github.repository_owner}}
password: ${{secrets.DOCKERHUB_KEY}}
- name: build and push image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
pull: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"uses": "docker/setup-buildx-action@v3"
}, {
"name": "build and load image",
"uses": "docker/build-push-action@v5",
"uses": "docker/build-push-action@v6",
"with": {
"load": true,
"pull": true,
Expand All @@ -51,7 +51,7 @@
}
}, {
"name": "test image",
"run": "docker run --rm --init --platform linux/${{matrix.arch}} ${{github.sha}} eval -p 'new Date()'"
"run": "docker run --init --rm --platform linux/${{matrix.arch}} ${{github.sha}} eval -p 'new Date()'"
}]
}
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: setup docker-buildx
uses: docker/setup-buildx-action@v3
- name: build and load image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
load: true
pull: true
Expand All @@ -37,4 +37,4 @@ jobs:
file: ${{matrix.os}}.dockerfile
build-args: DENO_VERSION=${{inputs.deno_version}}
- name: test image
run: docker run --rm --init --platform linux/${{matrix.arch}} ${{github.sha}} eval -p 'new Date()'
run: docker run --init --rm --platform linux/${{matrix.arch}} ${{github.sha}} eval -p 'new Date()'
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Easy to introduce in your project.

**As single image**
```sh
# Run REPL.
docker run --rm --init -it dojyorin/deno:latest
# Run repl
docker run --init --rm -it dojyorin/deno:latest

# Run script.
docker run --rm --init --restart always -p 0.0.0.0:5000:8000 -v $(pwd)/src:/data:ro dojyorin/deno:latest run /data/main.ts
# Run script
docker run --init --rm --restart always -p 0.0.0.0:8000:8000 -v $(pwd)/src:/data:ro dojyorin/deno:latest run /data/main.ts
```

**As compose**
Expand All @@ -44,7 +44,7 @@ services:
init: true
restart: always
ports:
- 0.0.0.0:5000:8000
- 0.0.0.0:8000:8000
volumes:
- ./src:/data:ro
command:
Expand Down
12 changes: 6 additions & 6 deletions src/alpine.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ FROM alpine:latest AS deno
ARG DENO_VERSION

RUN apk --update --no-cache add curl
RUN curl -Ls https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-$(arch)-unknown-linux-gnu.zip | unzip -q -d /tmp - 'deno'
RUN curl -Ls https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-$(arch)-unknown-linux-gnu.zip | unzip -pq - 'deno' > /tmp/deno

FROM gcr.io/distroless/cc-debian12:latest AS cc

FROM alpine:latest AS sym

COPY --from=cc --chown=root:root --chmod=755 /lib/*-linux-gnu/ld-linux-* /usr/local/lib/
COPY --from=cc --chmod=755 --chown=root:root /lib/*-linux-gnu/ld-linux-* /usr/local/lib/

RUN mkdir -p /tmp/lib
RUN ln -s /usr/local/lib/ld-linux-* /tmp/lib/
Expand All @@ -18,10 +18,10 @@ FROM alpine:latest

ENV LD_LIBRARY_PATH="/usr/local/lib"

COPY --from=deno --chown=root:root --chmod=755 /tmp/deno /usr/local/bin/
COPY --from=cc --chown=root:root --chmod=755 /lib/*-linux-gnu/* /usr/local/lib/
COPY --from=sym --chown=root:root --chmod=755 /tmp/lib /lib
COPY --from=sym --chown=root:root --chmod=755 /tmp/lib /lib64
COPY --from=deno --chmod=755 --chown=root:root /tmp/deno /usr/local/bin/
COPY --from=cc --chmod=755 --chown=root:root /lib/*-linux-gnu/* /usr/local/lib/
COPY --from=sym --chmod=755 --chown=root:root /tmp/lib /lib
COPY --from=sym --chmod=755 --chown=root:root /tmp/lib /lib64

RUN sed -i -e 's|nobody:/|nobody:/home|' /etc/passwd && chown nobody:nobody /home

Expand Down
12 changes: 6 additions & 6 deletions src/distroless.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ FROM alpine:latest AS deno
ARG DENO_VERSION

RUN apk --update --no-cache add curl
RUN curl -Ls https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-$(arch)-unknown-linux-gnu.zip | unzip -q -d /tmp - 'deno'
RUN curl -Ls https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-$(arch)-unknown-linux-gnu.zip | unzip -pq - 'deno' > /tmp/deno

FROM gcr.io/distroless/cc-debian12:latest AS cc

FROM alpine:latest AS sym

COPY --from=cc --chown=root:root --chmod=755 /lib/*-linux-gnu/ld-linux-* /usr/local/lib/
COPY --from=cc --chmod=755 --chown=root:root /lib/*-linux-gnu/ld-linux-* /usr/local/lib/

RUN mkdir -p /tmp/lib
RUN ln -s /usr/local/lib/ld-linux-* /tmp/lib/
Expand All @@ -18,10 +18,10 @@ FROM gcr.io/distroless/static-debian12:latest

ENV LD_LIBRARY_PATH="/usr/local/lib"

COPY --from=deno --chown=root:root --chmod=755 /tmp/deno /usr/local/bin/
COPY --from=cc --chown=root:root --chmod=755 /lib/*-linux-gnu/* /usr/local/lib/
COPY --from=sym --chown=root:root --chmod=755 /tmp/lib /lib
COPY --from=sym --chown=root:root --chmod=755 /tmp/lib /lib64
COPY --from=deno --chmod=755 --chown=root:root /tmp/deno /usr/local/bin/
COPY --from=cc --chmod=755 --chown=root:root /lib/*-linux-gnu/* /usr/local/lib/
COPY --from=sym --chmod=755 --chown=root:root /tmp/lib /lib
COPY --from=sym --chmod=755 --chown=root:root /tmp/lib /lib64

USER nonroot
ENTRYPOINT ["/usr/local/bin/deno"]

0 comments on commit c8df158

Please sign in to comment.