Skip to content

Commit

Permalink
Dockerfile build of deb install
Browse files Browse the repository at this point in the history
This makes it easier to generate an installation .deb for
any Debian based system through a Dockerfile, without having
to locally install the required dependencies.

This could potentially be used later on as a CI build step.
  • Loading branch information
markmandel authored and maxhbooth committed Feb 4, 2025
1 parent 42058a1 commit 755f5b1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=debian:trixie

FROM ${BASE_IMAGE}

RUN apt update && \
apt install -y curl libxkbcommon-dev libwayland-dev devscripts pkg-config

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

ENV PATH="$PATH:/root/.cargo/bin"

COPY / /wprs
WORKDIR /wprs

RUN dpkg-buildpackage --sanitize-env -us -uc -b -d -rfakeroot

WORKDIR /

RUN echo "Deb Files Created:" && ls *.deb
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ The launcher (`wprs`) requires:
This requires cargo and a rustc matching the one in rust-toolchain.toml to be
installed. The debian rustc package is not used due to being too old.

### Docker

To build .deb files without installing the above dependencies, we supply a `Dockerfile`.

To build the .deb and copy it locally:

```shell
docker build . -t wprs
docker run --user $(id -u):$(id -g) -v $(pwd):/deb --rm wprs:latest bash -c "cp *.deb /deb/"
```

By default, the `Dockerfile `builds against `debian:trixie` but you can use the `ARG`
`BASE_IMAGE` to overwrite this to another distribution and/or release version.

For example:

```shell
docker build --build-arg BASE_IMAGE=ubuntu . -t wprs
```

## Usage

Expand Down

0 comments on commit 755f5b1

Please sign in to comment.