Skip to content

Commit

Permalink
Docker: Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lantis1008 committed Dec 6, 2020
1 parent 68ce297 commit 7adcc9f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dev-utils/Docker/Dockerfile
@@ -0,0 +1,19 @@
FROM ubuntu:18.04

RUN export DEBIAN_FRONTEND=noninteractive; \
export DEBCONF_NONINTERACTIVE_SEEN=true; \
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
apt-get update &&\
apt-get install -qqy --no-install-recommends build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo curl ca-certificates ssh-client wget curl openssl file screen && \
curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
apt-get install -qqy nodejs npm && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
useradd -m user

USER user
WORKDIR /home/user

# set dummy git config
RUN git config --global user.name "user" && git config --global user.email "user@example.com"
48 changes: 48 additions & 0 deletions dev-utils/Docker/README.md
@@ -0,0 +1,48 @@
# Docker Gargoyle Builder

Build [Gargoyle](https://www.gargoyle-router.com/) images in a Docker container. This is sometimes necessary when building Gargoyle on the host system fails, e.g. when some dependency is too new. The docker image is based on the newest version of Ubuntu that was tested working with this branch.

Build tested:

- Gargoyle 1.10 (1.10.x)


## Prerequisites

* Docker installed
* Running Docker daemon
* Build Docker image:

```
git clone https://github.com/ericpaulbishop/gargoyle.git
cd gargoyle
git checkout 1.10
cd dev-utils/Docker
docker build -t gargoyle_builder_1.10.x .
```

Now the docker image is available. These steps only need to be done once.

## Usage GNU/Linux

Create a build folder (in this case we will use the just cloned Gargoyle repo) and link it into a new docker container:
```
docker run -v ~/gargoyle:/home/user -it gargoyle_builder_1.10.x /bin/bash
```
Note: If you don't use the cloned Gargoyle repo, you will need to clone it yourself from within the container.

In the container console, enter the make command for the target you wish to compile e.g.:
```
make FULL_BUILD=true ar71xx
```

After the build, the images will be inside `~/gargoyle/images/` and the packages inside `~/gargoyle/built/`.

## Other Projects

Other, but very similar projects:
* [docker-openwrt-buildroot](https://github.com/noonien/docker-openwrt-buildroot)
* [openwrt-docker-toolchain](https://github.com/mchsk/openwrt-docker-toolchain)

## Credits
To [mwarning](https://github.com/mwarning) for the original OpenWrt implementation this was based on.

0 comments on commit 7adcc9f

Please sign in to comment.