Comments (6)
Yay! I changed it to sha256sum -c to
make the check automatic.
For future viewers, make sure to reset to the commit id from which the build was created.
In the case of 0.0.5:
$ git reset --hard d0782dad2406005acdda4a0e96b30eab85234ac5
My updated dockerfile:
FROM alpine/git as release
RUN git clone -b v0.0.5 https://github.com/satackey/action-docker-layer-caching /app
WORKDIR /app
RUN sha256sum dist/ttsc-dist/main.js/index.js dist/ttsc-dist/post.js/index.js > SHA256SUMS
FROM node:12.16.2-slim
# Install latest yarn
RUN set -eux \
&& apt-get update \
&& apt-get install -y curl \
&& curl --compressed -o- -L https://yarnpkg.com/install.sh | bash \
&& apt-get remove -y curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install node_modules from package.json and yarn.lock
WORKDIR /app/frontend
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY post.ts main.ts tsconfig.json ./
COPY src src/
RUN npx ttsc --outDir ttsc-dist
RUN npx ncc build -o dist/ttsc-dist/main.js ttsc-dist/main.js
RUN npx ncc build -o dist/ttsc-dist/post.js ttsc-dist/post.js
COPY --from=release /app/SHA256SUMS .
RUN sha256sum -c SHA256SUMS
from action-docker-layer-caching.
Hmm, it is part of the cause, I created a Dockerfile so that I'd be able to control any tiny part of it (based on the Dockerfile in one of your repos :)
it still does not produce identical files to the ones in master-release..
clone master, create the dockerfile below and build it. The result should be in /app/frontend/dist
FROM node:12.16.2-slim
# Install latest yarn
RUN set -eux \
&& apt-get update \
&& apt-get install -y curl \
&& curl --compressed -o- -L https://yarnpkg.com/install.sh | bash \
&& apt-get remove -y curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install node_modules from package.json and yarn.lock
WORKDIR /app/frontend
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY post.ts main.ts tsconfig.json ./
COPY src src/
RUN ls
RUN npx ttsc
RUN npx ncc build -o dist/main.js ts-dist/main.js
RUN npx ncc build -o dist/post.js ts-dist/post.js
from action-docker-layer-caching.
@satackey Thanks! Would you like to include this somewhere official?
For future paranoids 😜
from action-docker-layer-caching.
I'm using ttypescript to use custom transformer, which is required by typescript-is that enables run-time type guard.
However, ncc doesn't support custom transformers, so you have to use ttsc
(the ttypescript version of the tsc
transform command) to transpile from TypeScript to JavaScript and then use ncc to get the same bundle file.
from action-docker-layer-caching.
Maybe The ttypescript and @zeit/ncc should different than the ones in the yarn-lock?
from action-docker-layer-caching.
With ncc, I found that the input file name affects the results.
So it seems that the --outDir ttsc-dist
needs to be added to ttsc
in order to reproduce the build.
FROM alpine/git
RUN git clone -b v0.0.5 https://github.com/satackey/action-docker-layer-caching /app
WORKDIR /app
RUN sha256sum dist/ttsc-dist/main.js/index.js dist/ttsc-dist/post.js/index.js
FROM node:12.16.2-slim
# Install latest yarn
RUN set -eux \
&& apt-get update \
&& apt-get install -y curl \
&& curl --compressed -o- -L https://yarnpkg.com/install.sh | bash \
&& apt-get remove -y curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install node_modules from package.json and yarn.lock
WORKDIR /app/frontend
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY post.ts main.ts tsconfig.json ./
COPY src src/
RUN ls
RUN npx ttsc --outDir ttsc-dist
RUN npx ncc build -o dist/main.js ttsc-dist/main.js
RUN npx ncc build -o dist/post.js ttsc-dist/post.js
RUN sha256sum dist/main.js/index.js dist/post.js/index.js
Now both of the hashes will be the following values and I think you can reproduce the build :)
0f2543e89d55839e1f529306793bf5c299bfc362a483ae3b99ab74eda23dd041 dist/main.js/index.js
1b7e9e552eaf7658117f5408d40355bb67a9feaf11d7bcadb5ccdcf0f44392ad dist/post.js/index.js
from action-docker-layer-caching.
Related Issues (20)
- Does it remove discarded layers from cache? [Question] HOT 1
- ReserveCacheError: Unable to reserve cache with key HOT 6
- docker load is slow
- Cache not wotking with BuildKit HOT 3
- Add a filter parameter - to select for the images to cache HOT 15
- Upgrade actions/cache to v2. HOT 6
- Abla to skip saving cache on condition HOT 1
- Feature Request: Alternative, larger cache disk space HOT 2
- Caching across runs HOT 6
- Cannot set concurrency
- [Security] Workflow release.yml is using vulnerable action satackey/push-prebuilt-action
- [Security] Workflow release.yml is using vulnerable action satackey/push-prebuilt-action HOT 1
- Rinning with the caching Slower then without a cache HOT 3
- GITHUB_TOKEN permissions used by this action
- getCacheEntry failed: Cache service responded with 503
- quiet mode
- Increases pipeline times instead of decreasing it HOT 3
- Use Node 16 instead of 12 HOT 4
- NEW FORK HOT 2
- Warning: The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-docker-layer-caching.