-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reusable Docker image #29
Changes from 6 commits
1d14ffd
b3e58a5
1660f0c
3b0bfd7
90c3c41
4f09557
a7c0395
7e9cb93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
FROM zmkfirmware/zmk-build-arm:2.4 | ||
|
||
RUN mkdir -p /app/firmware | ||
|
||
WORKDIR /app | ||
|
||
COPY config/west.yml config/west.yml | ||
|
@@ -13,7 +11,6 @@ RUN west update | |
# West Zephyr export | ||
RUN west zephyr-export | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be out-of-scope, and I'm not familiar with FootnotesThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, interesting. I combined these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha, my very next run demonstrated this in action:
The rule you linked to makes the tradeoff clear and I'm ok optimizing for speed in this case.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O sorry, it shouldn't do anything for the size/speed, should just effect the layers that Docker generates. I was thinking it may be a case similar to https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get (with subcommands like init and update). |
||
|
||
COPY config config | ||
COPY bin/build.sh ./ | ||
|
||
CMD ["./build.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.PHONY: clean timestamp setup | ||
|
||
all: setup build | ||
|
||
build: timestamp firmware/$$(TIMESTAMP)-left.uf2 firmware/$$(TIMESTAMP)-right.uf2 | ||
|
||
clean: | ||
rm ./firmware/*.uf2 | ||
|
||
firmware/%-left.uf2 firmware/%-right.uf2: config/adv360.keymap timestamp | ||
docker run --rm -it --name zmk \ | ||
-v $(PWD)/firmware:/app/firmware \ | ||
-v $(PWD)/config:/app/config:ro \ | ||
-e TIMESTAMP=$(TIMESTAMP) \ | ||
zmk | ||
|
||
setup: Dockerfile bin/build.sh config/west.yml | ||
docker build --tag zmk --file Dockerfile . | ||
|
||
timestamp: | ||
$(eval TIMESTAMP:=$(shell date -u +"%Y%m%d%H%M%S")) |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to apply #25 for v2 branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, i just omitted it here since there's an open PR for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pr has since been merged btw