Skip to content

Commit

Permalink
RDGRS-811: add build with FIPS and non-FIPS
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtonMan committed Sep 17, 2024
1 parent 2ecd4de commit 5a49c3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Dockerfile
ARG BASE_REG=edencore.azurecr.io/

# FIPS and non-FIPS build
FROM ${BASE_REG}cg_fips/go:1.22 as build
WORKDIR /app
COPY . .
RUN go mod download
RUN go build -o outsystemscc
# TODO: Import the FIPS module when it is required only
# - main.go: import _ "crypto/tls/fipsonly"
RUN go build -tags=requirefips -o outsystemscc-fips

# Package the final image
FROM ${BASE_REG}cg_fips/chainguard_base-fips:latest
COPY --from=build /app/outsystemscc /app/
ENTRYPOINT ["/app/outsystemscc"]
COPY --from=build /app/outsystemscc-fips /app/
ENTRYPOINT ["/app/outsystemscc-fips"]
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package main

// FIPS mode is enabled by importing the fipsonly package.
import (
_ "crypto/tls/fipsonly"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"net/http"
"os"
"runtime"
"strconv"
"strings"
"time"

"math/rand"

chclient "github.com/jpillora/chisel/client"
"github.com/jpillora/chisel/share/cos"
"github.com/jpillora/chisel/share/settings"
Expand Down

0 comments on commit 5a49c3b

Please sign in to comment.