Commit Graph

135 Commits

Author SHA1 Message Date
Andrei Zeliankou ace553dca4 Generated Dockerfiles for Unit 1.32.0 2024-02-27 12:24:44 +00:00
Andrew Clayton 4c558697bb Docker: Re-generate Dockerfile.wasm
This now includes support for the 'wasm-wasi-component' module.

This targets the upcoming 1.32.0 release which is required by
wasm-wasi-component. However of course the 1.32.0 tag doesn't exist yet,
so there will be a small window where this image won't build.

Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-02-21 16:20:32 +00:00
Andrew Clayton 1297f6f0f4 Docker: Add wasm-wasi-component to the wasm target
Thus

  $ make build-wasm

will build _both_ the 'wasm' & 'wasm-wasi-component' modules.

Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-02-21 16:20:32 +00:00
Andrew Clayton 7702293dda Docker: Bump rust version to 1.76.0
The minimum version required to build wasmtime 17 which is required by
wasm-wasi-component is 1.73.0

But no point not using the latest version.

This also now needs the libclang-dev package installed, we install this
via MODULE_PREBUILD_wasm.

Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-02-21 16:20:32 +00:00
Andrei Zeliankou f71ead5fa5 Updated copyright notice. 2024-02-20 16:08:36 +00:00
Dan Callahan d52a9361a8 Docker: Update versions of Go, Node, PHP, Ruby
- Go: Drop 1.20, Add 1.22
- Node: Drop 18, Add 21
- PHP: Add 8.3
- Ruby: Add 3.3

Perl and Python are still up-to-date with upstream releases

Regenerating the Dockerfiles also picks up the logging change from
183a1e9d63
2024-02-20 13:43:05 +00:00
Dan Callahan bd0abdf083 Docker: Shallow clone the Unit repo
Saves on the order of 10 MBs of transfer for each build.

We call `rm -rf /usr/src/unit` later in this step, so the full repo has
never appeared in our published images anyway.
2024-02-20 12:35:50 +00:00
Konstantin Pavlov 183a1e9d63 Docker: redirect logs to stderr
This allows to use /dev/stdout as application logs if users choose to do
so.

Closes: https://github.com/nginx/unit/issues/982
2024-02-20 12:25:00 +00:00
Andrei Zeliankou ea239635be Docker: Switch python3.12 to using github
Forgotten in
<https://github.com/nginx/unit/commit/c3af21e970ca3c822004cfda7c5b56ec07d99da9>
2024-02-19 15:18:13 +00:00
Konstantin Pavlov c3af21e970 Docker: Switch to github 2024-02-16 13:13:42 -08:00
tclesius 2b0d93d1a7 Docker: Generated Dockerfile for Unit 1.31.1. 2024-02-13 17:53:43 -08:00
tclesius 661e918a70 Docker: added python3.12 to versions 2024-02-13 17:53:43 -08:00
Andrei Zeliankou 09ab626b13 Generated Dockerfiles for Unit 1.31.1. 2023-10-17 14:15:38 +00:00
Liam Crilly 1617f2c045 Docker: fix HTML escaping. 2023-10-04 17:52:06 +01:00
Andrei Zeliankou fd43b1b0ce Generated Dockerfiles for Unit 1.31.0. 2023-08-23 11:29:07 +00:00
Konstantin Pavlov 31ce5001a0 Regenerated Dockerfiles. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 45bfba04bc Docker: remove gem caches in ruby images. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 7af9f1a175 Docker: remove maven caches in jsc images. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 4caf3abbe4 Docker: remove npm caches in node images. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 9292710f2e Docker: remove build-essential package. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov c1f0aeaea4 Docker: added a container-diff helper.
It's useful to check whether resulting images have unexpected build
leftovers.

Requires https://github.com/GoogleContainerTools/container-diff in
$PATH.
2023-08-22 14:55:10 -07:00
Konstantin Pavlov 78a473743d Docker: be POSIX-compliant in the library creation script. 2023-08-22 14:55:10 -07:00
RomainMou f311b1f3aa Docker: avoid error if /docker-entrypoint.d already exists.
Closes #865.
2023-08-22 14:55:10 -07:00
Konstantin Pavlov c79c60be1c Docker: bumped language versions. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 3562c68ce7 Docker: added meaningful title to metadata. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 5ed7dd53c1 Docker: added wasm variant. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov 7874798a3f Docker: use a specific directory to build unit. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov e516d918ed Docker: introduced a "module prebuild" step.
It's now used to install node-gyp on nodejs images.
Starting from node:20, they no longer ship node-gyp that we require to
build the modules with, so we need to install it manually.

Fixes https://github.com/nginx/unit/issues/908.
2023-08-22 14:55:10 -07:00
Konstantin Pavlov ffc6e6b08f Packages: specify runstatedir and logdir explicitely. 2023-08-22 14:55:10 -07:00
Konstantin Pavlov dc03914418 Regenerated dockerfiles. 2023-05-09 20:20:28 -07:00
Liam Crilly d481801907 Docker: show welcome page on port 80 when entrypoint.d is empty.
The entrypoint script now performs a default configuration when no useful
files are found in /docker-entrypoint.d/

The default configuration serves a welcome page in response to all
requests, using Markdown unless text/html is sent in the Accept header.

This provides a useful 'hello world' experience when running a Unit
container for the first time.
2023-05-09 22:53:18 +01:00
Konstantin Pavlov 8ab16f71fe Docker: tagged minimal variant as latest. 2023-05-05 17:20:10 -07:00
Konstantin Pavlov 5b98d87e52 Docker: Makefile housekeeping. 2023-05-05 17:20:06 -07:00
Konstantin Pavlov 6e548cbb30 Docker: added a way to generate multiple versions of an image. 2023-05-05 17:19:55 -07:00
Liam Crilly 20a5fd44ac Docker: add support for JavaScript modules. 2023-05-09 19:19:36 +01:00
Konstantin Pavlov 86a701abe0 Docker: made curl fail with non-zero exit code on server errors. 2023-04-12 16:00:32 -07:00
Konstantin Pavlov bfd9a0a30a Docker: fixed a typo. 2023-04-11 15:39:42 -07:00
Konstantin Pavlov 028e537bef Docker: fixed git references. 2023-03-28 14:45:10 -07:00
Konstantin Pavlov 5d83ee6660 Docker: drop apt-get clean usage.
It's automatic in the Debian and Ubuntu containers: https://github.com/debuerreotype/debuerreotype/blob/5cf7949ecf1cec1afece267688bda64cd34a6817/scripts/debuerreotype-minimizing-config#L85-L109
2023-04-06 20:43:22 -07:00
Konstantin Pavlov 472c6d0fb0 Docker: explicitely set uid/gid to 999 for unit user.
This allows us to be consistent through possible updates of default
settings used in distributions.  Previous behaviour was uid/gid were
chosen automatically based on what uids/gids are already taken on the
system.
2023-04-06 20:43:22 -07:00
Konstantin Pavlov 6d51672d8d Packages: use groupadd/useradd on Debian-based operating systems.
addgroup/adduser will no longer be installed by default in the
"minbase".  Also, moving to lower-level utilities saves us one runtime
dependency.
2023-04-06 20:43:22 -07:00
Konstantin Pavlov 886aa17e79 Docker: added OCI image-spec labels. 2023-04-06 20:43:22 -07:00
Konstantin Pavlov 09cd3793aa Docker: specified explicit variants of images to use.
This allows us to decide when to move to a newer underlying distribution
version with our pace instead of relying on Docker Hub cadence.
2023-04-06 20:43:22 -07:00
Konstantin Pavlov 6ed5f1654e Docker: dropped a leftover from a multi-stage build. 2023-04-06 20:43:22 -07:00
Konstantin Pavlov 8392f8c902 Docker: check out packaging tags.
This will ensure we're checking out source code that is close to what we
have in binary packages.

While at it, remove the checkout directory when it's no longer needed.
2023-04-10 15:36:48 -07:00
Konstantin Pavlov 31424f409e Docker: added njs support. 2023-03-30 16:17:59 -07:00
Alejandro Colomar 6e16d7ac5b Auto: mirroring installation structure in build tree.
This makes the build tree more organized, which is good for adding new
stuff.  Now, it's useful for example for adding manual pages in man3/,
but it may be useful in the future for example for extending the build
system to run linters (e.g., clang-tidy(1), Clang analyzer, ...) on the
C source code.

Previously, the build tree was quite flat, and looked like this (after
`./configure && make`):

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── echo
    ├── libnxt.a
    ├── nxt_auto_config.h
    ├── nxt_version.h
    ├── unitd
    └── unitd.8

    1 directory, 9 files

And after this patch, it looks like this:

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── bin
    │   └── echo
    ├── include
    │   ├── nxt_auto_config.h
    │   └── nxt_version.h
    ├── lib
    │   ├── libnxt.a
    │   └── unit
    │       └── modules
    ├── sbin
    │   └── unitd
    ├── share
    │   └── man
    │       └── man8
    │           └── unitd.8
    └── var
        ├── lib
        │   └── unit
        ├── log
        │   └── unit
        └── run
            └── unit

    17 directories, 9 files

It also solves one issue introduced in
5a37171f73 ("Added default values for pathnames.").  Before that
commit, it was possible to run unitd from the build system
(`./build/unitd`).  Now, since it expects files in a very specific
location, that has been broken.  By having a directory structure that
mirrors the installation, it's possible to trick it to believe it's
installed, and run it from there:

    $ ./configure --prefix=./build
    $ make
    $ ./build/sbin/unitd

Fixes: 5a37171f73 ("Added default values for pathnames.")
Reported-by: Liam Crilly <liam@nginx.com>
Reviewed-by: Konstantin Pavlov <thresh@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Cc: Andrei Zeliankou <zelenkov@nginx.com>
Cc: Zhidao Hong <z.hong@f5.com>
Signed-off-by: Alejandro Colomar <alx@nginx.com>
2023-03-29 00:41:08 +02:00
Alejandro Colomar 5ba79b9b52 Renamed --libstatedir to --statedir.
In BSD systems, it's usually </var/db> or some other dir under </var>
that is not </var/lib>, so $statedir is a more generic name.  See
hier(7).

Reported-by: Andrei Zeliankou <zelenkov@nginx.com>
Reported-by: Zhidao Hong <z.hong@f5.com>
Reviewed-by: Konstantin Pavlov <thresh@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Cc: Liam Crilly <liam@nginx.com>
Signed-off-by: Alejandro Colomar <alx@nginx.com>
2023-03-29 00:40:40 +02:00
Konstantin Pavlov 565dcbb139 Docker: bumped language versions. 2023-02-13 17:04:24 -08:00
Konstantin Pavlov 2a597c5c7a Docker: limited the waiting time for control socket creation.
While at it, fixed a typo.
2023-02-13 17:04:24 -08:00