docker compose build with npm nexus registry in private network using github action and tailscale

70 Views Asked by At

I have a nexus registry located in private network i need docker-compose build in github action that can build a dockerfile which could be interactive /accessible to nexus

I've done on

  • created tailscale network, joined and expose my nexus registry (in k8s) to tailnet
  • the nexus registry is listening on specific domain eg: example.com
  • after register nexus k8s service to tailscale following this we had nexus in tailnet domain: <servicenamene>.tailxxxxx.ts.net

I've setup github action like below

        steps:
            - name: Tailscale
              uses: tailscale/github-action@v2
              with:
                oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
                oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
                tags: "tag:k8s"
                version: 1.56.0
            - uses: actions/checkout@v2
            - run: docker login -u xxx -p ${{ secrets.DOCKER_PASSWORD }} xxx.xxx.io
            - run: |
                .... docker-compose build ...

The Dockerfile looks like below:


###

FROM node:$NODE_VERSION as builder

ARG NEXUS_NPM_TOKEN
ARG NEXUS_CERT_FILE

RUN npm config set //<servicenamene>.tailxxxxx.ts.net:8080/repository/npm-xxx/:_authToken $NEXUS_NPM_TOKEN  \
  && npm config set @psa:registry http://<servicenamene>.tailxxxxx.ts.net:8080/repository/npm-xxx/ 

###

however seem like nexus doesn't accept request that had host header don't match with nexusHttpHost or $NEXUS_HTTP_HOST

any idea?

0

There are 0 best solutions below