-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docker): run optic as unprivileged user (#2756)
- Loading branch information
Showing
10 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
FROM alpine:latest | ||
|
||
# Doing the intial installation of Optic and Spectral separately | ||
# saves a bit of space in the final image--Probably due to temp | ||
# file creation. | ||
FROM alpine:latest as dl | ||
ARG OPTIC_CLI_VERSION=latest | ||
|
||
RUN apk --no-cache add git curl | ||
RUN echo "optic-docker" > /etc/machine-id | ||
RUN apk --no-cache add curl | ||
# install Optic | ||
RUN set -e; sh -c "$(curl -s --location https://install.useoptic.com/install.sh)" -- $OPTIC_CLI_VERSION /usr/local/bin | ||
# install Spectral | ||
RUN curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sh | ||
|
||
FROM alpine:latest | ||
ENV INSTALLATION_METHOD="docker" | ||
RUN addgroup -S optic && \ | ||
adduser -S optic -G optic && \ | ||
apk --no-cache add git curl && \ | ||
echo "optic-docker" > /etc/machine-id | ||
|
||
COPY --from=dl /usr/local/bin/optic /usr/local/bin/ | ||
COPY --from=dl /usr/local/bin/spectral /usr/local/bin/ | ||
|
||
USER optic | ||
ENTRYPOINT ["/usr/local/bin/optic"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/fastify-capture", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/json-pointer-helpers", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/openapi-io", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/openapi-utilities", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/optic", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/rulesets-base", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/standard-rulesets", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.54.7", | ||
"version": "0.54.8", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|