Merge pull request #17 from infokiller/dockerfile

add dockerfile
This commit is contained in:
nonpop 2021-11-06 15:09:01 +02:00 committed by GitHub
commit f311779ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

15
.dockerignore Normal file
View File

@ -0,0 +1,15 @@
# Exclude Dockerfile and .dockerignore so that the docker layer cache won't be
# invalidated after editing them (which changes the build context if they are
# not ignored).
*Dockerfile*
.dockerignore
# Exclude git metadata since we only care about the working tree.
.git
.gitattributes
.gitignore
# Exclude docs
*.md
*~
*.o
xkblayout-state

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM alpine:3.14.2 AS build
RUN apk add --no-cache g++ libx11-dev make
WORKDIR /repo
COPY . .
RUN make
# RUN make && chmod a+x ./xkblayout-state
# Export to a minimal runtime image and run as an unprivileged user.
FROM alpine:3.14.2
RUN apk add --no-cache libstdc++ libx11
USER 1000:1000
WORKDIR /repo
COPY --from=build --chown=1000:1000 /repo/xkblayout-state .
ENTRYPOINT ["./xkblayout-state"]

View File

@ -17,6 +17,7 @@ Compilation and installation
- To compile just say: `make` - To compile just say: `make`
- To install copy the resulting executable `xkblayout-state` somewhere in your path - To install copy the resulting executable `xkblayout-state` somewhere in your path
Alternatively with docker: `docker build .`
Usage Usage
----- -----