Merge branch 'master' into nvdupdates

master
Jimmy Zelinskie 6 years ago committed by GitHub
commit f32f438a98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,18 +12,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM golang:1.10-alpine FROM golang:1.10-alpine AS build
VOLUME /config
EXPOSE 6060 6061
ADD . /go/src/github.com/coreos/clair/ ADD . /go/src/github.com/coreos/clair/
WORKDIR /go/src/github.com/coreos/clair/ WORKDIR /go/src/github.com/coreos/clair/
RUN go build github.com/coreos/clair/cmd/clair
RUN apk add --no-cache git rpm xz dumb-init && \ FROM alpine:3.8
go install -v github.com/coreos/clair/cmd/clair && \ COPY --from=build /go/src/github.com/coreos/clair/clair /clair
mv /go/bin/clair /clair && \ RUN apk add --no-cache git rpm xz ca-certificates dumb-init
rm -rf /go /usr/local/go
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/clair"] ENTRYPOINT ["/usr/bin/dumb-init", "--", "/clair"]
VOLUME /config
EXPOSE 6060 6061

@ -26,6 +26,7 @@ import (
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os" "os"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -153,7 +154,7 @@ func getDataFeeds(dataFeedHashes map[string]string, localPath string) (map[strin
// Create map containing the name and filename for every data feed. // Create map containing the name and filename for every data feed.
dataFeedReaders := make(map[string]string) dataFeedReaders := make(map[string]string)
for _, dataFeedName := range dataFeedNames { for _, dataFeedName := range dataFeedNames {
fileName := localPath + dataFeedName + ".xml" fileName := filepath.Join(localPath, fmt.Sprintf("%s.xml", dataFeedName))
if h, ok := dataFeedHashes[dataFeedName]; ok && h == dataFeedHashes[dataFeedName] { if h, ok := dataFeedHashes[dataFeedName]; ok && h == dataFeedHashes[dataFeedName] {
// The hash is known, the disk should contains the feed. Try to read from it. // The hash is known, the disk should contains the feed. Try to read from it.
if localPath != "" { if localPath != "" {

Loading…
Cancel
Save