Skip to content

Commit 30ce794

Browse files
authored
feat(docker): build and publish unpriviledged image (#3705)
Co-authored-by: marius-boden-sva Refs #3033 Refs #3697
1 parent 312798a commit 30ce794

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

.github/workflows/docker-build-push.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,12 @@ jobs:
6363
push: true
6464
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/386,linux/ppc64le,linux/s390x
6565
tags: swaggerapi/swagger-editor:next-v5
66+
67+
- name: Build unprivileged docker image and push
68+
uses: docker/build-push-action@v3
69+
with:
70+
context: .
71+
file: Dockerfile.unprivileged
72+
push: true
73+
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/386,linux/ppc64le,linux/s390x
74+
tags: swaggerapi/swagger-editor:next-v5-unprivileged

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM nginx:1.23.2-alpine
2-
32
COPY ./build /usr/share/nginx/html
4-
53
EXPOSE 8080
6-
74
# start nginx
85
CMD ["nginx", "-g", "daemon off;"]

Dockerfile.unprivileged

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nginxinc/nginx-unprivileged:1.23.2-alpine
2+
COPY ./build /usr/share/nginx/html
3+
EXPOSE 8080
4+
# start nginx
5+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,26 @@ $ docker run -d -p 8080:80 swaggerapi/swagger-editor:next-v5
504504
505505
### Building locally
506506
507+
**Privileged image**:
508+
507509
```sh
508510
$ npm run build:app
509511
$ docker build . -t swaggerapi/swagger-editor:next-v5
510512
$ docker run -d -p 8080:80 swaggerapi/swagger-editor:next-v5
511513
```
512514
513-
Now open your browser at `http://localhost:8888/`.
515+
Now open your browser at `http://localhost:8080/`.
516+
517+
**Unprivileged image**:
518+
519+
```sh
520+
$ npm run build:app
521+
$ docker build . -f Dockerfile.unprivileged -t swaggerapi/swagger-editor:next-v5-unprivileged
522+
$ docker run -d -p 8080:8080 swaggerapi/swagger-editor:next-v5-unprivileged
523+
```
524+
525+
Now open your browser at `http://localhost:8080/`.
526+
514527
515528
> **No** custom environment variables are currently supported by SwaggerEditor.
516529

0 commit comments

Comments
 (0)