Skip to content

Commit

Permalink
Move Docker related stuff to platform/linux/docker
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Jul 24, 2024
1 parent ac8a867 commit 1db117d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion platform/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cd maplibre-native
```

## Requirements

### Building without Docker

```bash
Expand All @@ -26,7 +27,7 @@ Optional: `libsqlite3-dev` (also available as vendored dependency).

### Building with Docker

See instructions in [docker/README.md](../../docker/README.md) to build docker container
See instructions in [docker/README.md](docker/README.md) to build in a docker container.

## Build

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 12 additions & 11 deletions docker/README.md → platform/linux/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Linux

These steps will allow you to compile code as described [platform/linux/README.md](../platform/linux/README.md) using a docker container. All the steps should be executed from the root of the repository.
These steps will allow you to compile code as described [platform/linux/README.md](../README.md) using a Docker container. All the steps should be executed from the root of the repository.

ATTENTION: You cannot build MapLibre native using both Docker and host methods at the same time. If you want to switch, you need to clean the repository first, e.g. by using this command:

```bash
git clean -dxfi -e .idea -e .clwb -e .vscode
```
> [!IMPORTANT]
> You cannot build MapLibre native using both Docker and host methods at the same time. If you want to switch, you need to clean the repository first, e.g. by using this command:
>
> ```bash
> git clean -dxfi -e .idea -e .clwb -e .vscode
> ```
### Build Docker Image
You must build your own docker image, specific with your user and group IDs to ensure file permissions stay correct.
You must build your own Docker image, specific with your user and group IDs to ensure file permissions stay correct.
```bash
# Build docker image from the repo __root__
Expand All @@ -20,20 +21,20 @@ docker build \
-t maplibre-native-image \
--build-arg USER_UID=$(id -u) \
--build-arg USER_GID=$(id -g) \
-f docker/Dockerfile \
docker
-f platform/linux/docker/Dockerfile \
platform/linux/docker
```
## Run Docker Container

```bash
# Run all build commands using the docker container.
# You can also execute build commands from inside the docker container by starting it without the build command.
docker run --rm -it -v "$PWD:/app/" -v "$PWD/docker/.cache:/home/user/.cache" maplibre-native-image
docker run --rm -it -v "$PWD:/app/" -v "$PWD/platform/linux/docker/.cache:/home/user/.cache" maplibre-native-image
```

You can also run any command inside the container, for example:

```bash
docker run --rm -it -v "$PWD:/app/" -v "$PWD/docker/.cache:/home/user/.cache" maplibre-native-image cmake ...
docker run --rm -it -v "$PWD:/app/" -v "$PWD/platform/linux/docker/.cache:/home/user/.cache" maplibre-native-image cmake ...
```
File renamed without changes.

0 comments on commit 1db117d

Please sign in to comment.