Skip to content

Commit

Permalink
Added changes to address issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
n-murphy committed Aug 8, 2022
1 parent c52db70 commit 24c1063
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
FROM alpine:latest AS client-builder

RUN apk fix && \
apk --no-cache --update add git

WORKDIR /tmp

RUN git clone https://github.com/swagger-api/swagger-editor.git


FROM scratch
FROM alpine

LABEL org.opencontainers.image.title="Swagger Editor" \
org.opencontainers.image.description="Swagger Editor Docker extension" \
Expand All @@ -21,6 +11,7 @@ LABEL org.opencontainers.image.title="Swagger Editor" \
com.docker.extension.additional-urls='[{"title":"Swagger","url":"https://swagger.io/"}]' \
com.docker.extension.changelog=""

COPY --from=client-builder /tmp/swagger-editor ./swagger-editor
COPY swagger.svg swagger.svg
COPY swagger.svg .
COPY docker-compose.yaml .
COPY metadata.json .
COPY ui ui
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ From version **4.10.0** of Docker Desktop you no longer need to manaully install
If you want to build the extension locally then run the following:
```
# build the extension
docker buildx build -t noelm/swagger-editor-extension:0.0.4 .
docker buildx build -t noelm/swagger-editor-extension:4.3.0 .
# validate the extension
docker extension validate noelm/swagger-editor-extension:0.0.4
docker extension validate noelm/swagger-editor-extension:4.3.0
# you should get the following message:
# The extension image "noelm/swagger-editor-extension:0.0.4" is valid
# The extension image "noelm/swagger-editor-extension:4.3.0" is valid
```

### Install the extension

You can of course skip the build process above and jump straight to installation by running the following:
**Note** The current image hosted on docker hub with the 0.0.4 tag has been tested on Ubuntu 20.04 and MacOS.
**Note** The current image hosted on docker hub with the `4.3.0` tag has been tested on Ubuntu 20.04 and MacOS.
```
docker extension install noelm/swagger-editor-extension:0.0.4
docker extension install noelm/swagger-editor-extension:4.3.0
```

![Swagger Editor Docker Ext](Swagger-Editor-Docker-Ext.png?raw=true "Swagger Editor Docker Extension")


### Remove the extension
```
docker extension uninstall noelm/swagger-editor-extension:0.0.4
docker extension uninstall noelm/swagger-editor-extension:4.3.0
```
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
services:
swagger-editor:
image: noelm/swagger-editor:4.3.0
container_name: swagger-editor
ports:
- 8080:8080
5 changes: 4 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"icon": "swagger.svg",
"vm": {
"composefile": "docker-compose.yaml"
},
"ui": {
"dashboard-tab": {
"title": "Swagger Editor",
"root": "/swagger-editor",
"root": "/ui",
"src": "index.html"
}
}
Expand Down
15 changes: 15 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta http-equiv="refresh" content="0; url='http://localhost:8080'" />
<title>Swagger Editor</title>
</head>

<body style="margin:0px;padding:0px;overflow:hidden">
<p>Please follow <a href="http://localhost:8080">this link</a>.</p>
</body>

</html>

0 comments on commit 24c1063

Please sign in to comment.