Public | Automated Build

Last pushed: 9 months ago
Short Description
nexus3-oss
Full Description

Nexus 3

A Nexus 3 container based on the official Sonatype image. It extends the image by providing a configure.sh script, which allows you to configure Nexus. The script will wait for Nexus to start. See [https://books.sonatype.com/nexus-book/3.0/reference/scripting.html#_writing_scripts] for details on creating such a script.

Usage

Run this image as normal to start Nexus, but also pass the credentials via environment variables so that the configure script can exexcute scripts on the Nexus instance.

If using Kubernetes you can use a PostStart hook to trigger the script in the container
`docker run -e USERNAME <user> -e PASSWORD <passw> -v <script>:/opt/sonatype/nexus/ nexus

Kubernetes sample

Excerpt

...
      containers:
      - name: nexus
        image: ffung/nexus
        imagePullPolicy: Always
        env:
        - name: USERNAME
          value: 'admin'
        - name: PASSWORD
          valueFrom:
            secretKeyRef:
              name: nexus-pass
              key: password
        volumeMounts:
        - name: nexus-store
          mountPath: /nexus-data
        - name: nexus-scripts
          mountPath: /nexus-scripts
        ports:
        - containerPort: 8081
          name: nexus
          protocol: TCP
        lifecycle:
          postStart:
            exec:
              command:
                - "configure.sh"
                - "/nexus-scripts/configure.json"

Mandatory environment arguments

  • USERNAME - Nexus user
  • PASSWORD - Nexus password

Nexus script

You are required to make the script available to the container, either via a volume mount or by extending this container

Docker Pull Command
Owner
enieuw
Source Repository

Comments (0)