From e1f3f7aac8ed46fe03aee72b73648ca9e8a3acc1 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Wed, 1 Feb 2017 21:23:31 -0800 Subject: [PATCH 1/6] Updating README - adding warning about TTY flag: -t - removing TTY flag from examples that causes extra line - minor title formatting and badge changes --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f697ffe..4475bd1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -Unofficial Autodesk License Manager FLEXlm® Network Server container -==================================================================== -[![Docker Automated buil](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() +ADLMFlexNetServer +================= +[![Docker Automated buil](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![](https://img.shields.io/docker/pulls/haysclark/adlmflexnetserver.svg)](https://hub.docker.com/r/haysclark/adlmflexnetserver 'DockerHub') [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() -A simple Docker container that runs Autodesk License Manager FLEXlm® Network Server. + > Unofficial Autodesk License Manager FLEXlm® Network Server container. Usage ----- @@ -11,7 +11,7 @@ To use this container, simply treat it as if you were calling _lmgrd_ directly. The container does expect the user to map a local license file to within the __/var/flexlm__ directory. - docker run -d -t --mac-address="[LICENSE_MAC_ADDRESS]" \ + docker run -d --mac-address="[LICENSE_MAC_ADDRESS]" \ -h [LICENSE_HOSTNAME] \ -v [LOCAL_LICENSE_PATH]:/var/flexlm/adsk_server.lic:ro \ -p 2080:2080 -p 27000-27009:27000-27009 \ @@ -20,7 +20,7 @@ The container does expect the user to map a local license file to within the __/ Alternatively, you can map a local folder containing multiple keys to the __/var/flexlm__ directory. - docker run -d -t --mac-address="[LICENSE_MAC_ADDRESS]" \ + docker run -d --mac-address="[LICENSE_MAC_ADDRESS]" \ -h [LICENSE_HOSTNAME] \ -v [LOCAL_LICENSE_FOLDER_PATH]:/var/flexlm \ -p 2080:2080 -p 27000-27009:27000-27009 \ @@ -33,7 +33,7 @@ Docker's built-in logging functionality will collect the stdout/stderr generated docker logs [CONTAINER_ID] -Thus it's recommended you do NOT use the _-l_ flag to log to a file, doing so will cause your Docker logs to be empty. +Thus it's recommended you do NOT use the '-l' flag to log to a file, doing so will cause your Docker logs to be empty. Additionally, avoid using the '-t' flag when using the 'run' command, enabling TTL support will cause extra line breaks in your Docker logs. Troubleshooting --------------- From 53c14a2ab2b5fa1a70e40e1ad2fc8c55c449957d Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Fri, 3 Feb 2017 22:46:43 -0800 Subject: [PATCH 2/6] cleaning up and standardizing setup --- Dockerfile | 35 ++++++++++++++++++++-------- entrypoint.sh => files/entrypoint.sh | 0 utils.sh => files/utils.sh | 0 3 files changed, 25 insertions(+), 10 deletions(-) rename entrypoint.sh => files/entrypoint.sh (100%) rename utils.sh => files/utils.sh (100%) diff --git a/Dockerfile b/Dockerfile index 0f65d07..d25d684 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,26 @@ - FROM centos:centos6 - MAINTAINER hays.clark@gmail.com +######################################### +## CONSTANTS ## +######################################### +# path for Network Licence Manager ARG NLM_URL=http://download.autodesk.com/us/support/files/network_license_manager/11_13_1_2_v2/Linux/nlm11.13.1.2_ipv4_ipv6_linux64.tar.gz +# path for temporary files ARG TEMP_PATH=/tmp/flexnetserver -EXPOSE 2080 -EXPOSE 27000-27009 +######################################### +## ENVIRONMENTAL CONFIG ## +######################################### +# add the flexlm commands to $PATH +ENV PATH="${PATH}:/opt/flexnetserver/" -# Ideally this list of dependancies will be trimmed down +######################################### +## RUN INSTALL SCRIPT ## +######################################### +ADD /files /usr/local/bin + +# ideally redhat-lsb could be trimmed down RUN yum update -y && yum install -y \ redhat-lsb \ wget && \ @@ -24,15 +35,19 @@ RUN mkdir -p ${TEMP_PATH} && cd ${TEMP_PATH} && \ RUN groupadd -r lmadmin && \ useradd -r -g lmadmin lmadmin +######################################### +## VOLUMES ## +######################################### VOLUME ["/var/flexlm"] -# add the flexlm commands to $PATH -ENV PATH="${PATH}:/opt/flexnetserver/" +######################################### +## EXPOSE PORTS ## +######################################### +EXPOSE 2080 +EXPOSE 27000-27009 # do not use ROOT user USER lmadmin -COPY entrypoint.sh /usr/local/bin/entrypoint.sh -COPY utils.sh /usr/local/bin/utils.sh - ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +# no CMD, use container as if 'lmgrd' diff --git a/entrypoint.sh b/files/entrypoint.sh similarity index 100% rename from entrypoint.sh rename to files/entrypoint.sh diff --git a/utils.sh b/files/utils.sh similarity index 100% rename from utils.sh rename to files/utils.sh From 1ab01e1ed64424679509a2f1d27e6ebe47abfd3e Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Fri, 3 Feb 2017 23:15:28 -0800 Subject: [PATCH 3/6] Reducing container size - reduced image size from 836 MB to 580 MB --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d25d684..c41dfef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,9 +20,8 @@ ENV PATH="${PATH}:/opt/flexnetserver/" ######################################### ADD /files /usr/local/bin -# ideally redhat-lsb could be trimmed down RUN yum update -y && yum install -y \ - redhat-lsb \ + redhat-lsb-core \ wget && \ yum clean all From aeba949b2346e7e4a54cd351ff1633ffca05e3d1 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Sat, 4 Feb 2017 00:21:51 -0800 Subject: [PATCH 4/6] updating changelog --- CHANGELOG.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bd5fe8..d239973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,19 @@ + +# [1.0.0](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.2...1.0.0) (2017-02-04) + +### Features +- reduced container size by ~250MB +- reorganized repo +- cleaned up Dockerfile + -# [](https://github.com/haysclark/adlmflexnetserver/compare/v0.9.1...0.9.2) (2017-01-19) +# [0.9.2](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.1...0.9.2) (2017-01-19) ### Features - new entrypoint.sh which makes custom service startup easier -## [0.9.1](https://github.com/haysclark/adlmflexnetserver/compare/v0.9.0...v0.9.1) (2017-01-18) +## [0.9.1](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.0...v0.9.1) (2017-01-18) ### Improvements - Eliminating all default arguments to fix both the logging issues and removing all magical paths and values. Props to @hyperknot From c6052a9fb2d34037b3cab0afa35050272666c846 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Thu, 30 Jan 2020 11:58:03 -0800 Subject: [PATCH 5/6] chore: Add Autodesk 2020 product support (#9) * chore: updating NLM to v11.16.2.0 - needed for 2020 product support - is backwards compatible (tested with Maya 2014). * chore: updating docs and comments Co-authored-by: Florian Sesser --- Dockerfile | 6 +++--- README.md | 53 ++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index c41dfef..f7bac37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM centos:centos6 MAINTAINER hays.clark@gmail.com ######################################### -## CONSTANTS ## +## BUILD-TIME VARIABLES ## ######################################### -# path for Network Licence Manager -ARG NLM_URL=http://download.autodesk.com/us/support/files/network_license_manager/11_13_1_2_v2/Linux/nlm11.13.1.2_ipv4_ipv6_linux64.tar.gz +# url for Network Licence Manager +ARG NLM_URL=https://knowledge.autodesk.com/sites/default/files/file_downloads/nlm11.16.2.0_ipv4_ipv6_linux64.tar.gz # path for temporary files ARG TEMP_PATH=/tmp/flexnetserver diff --git a/README.md b/README.md index 4475bd1..daad1e9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ADLMFlexNetServer ================= -[![Docker Automated buil](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![](https://img.shields.io/docker/pulls/haysclark/adlmflexnetserver.svg)](https://hub.docker.com/r/haysclark/adlmflexnetserver 'DockerHub') [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() +[![Docker Automated build](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![](https://img.shields.io/docker/pulls/haysclark/adlmflexnetserver.svg)](https://hub.docker.com/r/haysclark/adlmflexnetserver 'DockerHub') [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() > Unofficial Autodesk License Manager FLEXlm® Network Server container. @@ -11,18 +11,18 @@ To use this container, simply treat it as if you were calling _lmgrd_ directly. The container does expect the user to map a local license file to within the __/var/flexlm__ directory. - docker run -d --mac-address="[LICENSE_MAC_ADDRESS]" \ - -h [LICENSE_HOSTNAME] \ - -v [LOCAL_LICENSE_PATH]:/var/flexlm/adsk_server.lic:ro \ + docker run -d --mac-address= \ + -h \ + -v :/var/flexlm/adsk_server.lic:ro \ -p 2080:2080 -p 27000-27009:27000-27009 \ haysclark/adlmflexnetserver -c /var/flexlm/adsk_server.lic - Alternatively, you can map a local folder containing multiple keys to the __/var/flexlm__ directory. +Alternatively, you can map a local folder containing multiple keys to the __/var/flexlm__ directory. - docker run -d --mac-address="[LICENSE_MAC_ADDRESS]" \ - -h [LICENSE_HOSTNAME] \ - -v [LOCAL_LICENSE_FOLDER_PATH]:/var/flexlm \ + docker run -d --mac-address= \ + -h \ + -v :/var/flexlm \ -p 2080:2080 -p 27000-27009:27000-27009 \ haysclark/adlmflexnetserver -c /var/flexlm/license_file_1:/var/flexlm/license_file_2 @@ -31,7 +31,7 @@ The container does expect the user to map a local license file to within the __/ Docker's built-in logging functionality will collect the stdout/stderr generated by _lmgrd_. - docker logs [CONTAINER_ID] + docker logs Thus it's recommended you do NOT use the '-l' flag to log to a file, doing so will cause your Docker logs to be empty. Additionally, avoid using the '-t' flag when using the 'run' command, enabling TTL support will cause extra line breaks in your Docker logs. @@ -40,16 +40,43 @@ Troubleshooting If you are unsure if the server is running correctly, you can log into the container. - docker exec -it CONTAINER_ID /bin/bash + docker exec -it /bin/bash Once in bash run: - lmutil lmstat -a -c [LICENSE_PATH] + lmutil lmstat -a -c + +Image Variants +-------------- + +### haysclark/adlmflexnetserver: + +| Version | Description | +|---------|-----------------------------------------------------------------------| +| v1.0.0 | Uses NLM 11.13.1.2 (support pre-2020 products) | +| v1.0.1 | Uses NLM 11.16.2.0 (required for 2020 products / backwards compatible | + +Building Custom Image +--------------------- +If a specific version of _nlm_ is needed, you can compile it locally. + +### Build Arguments + +The following build arguments have been exposed. + +| Name | Description | +|-----------|---------------------------------| +| NLM_URL | url for Network License Manager | +| TEMP_PATH | path for temporary files | + +Usage example: + + docker build --build-arg NLM_URL= . Resources --------- -[Official Docs](https://knowledge.autodesk.com/support/maya/downloads/caas/downloads/content/autodesk-network-license-manager-for-linux.html?v=2014) +- [Official Docs](https://knowledge.autodesk.com/search-result/caas/downloads/content/autodesk-network-license-manager-for-linux.html) Supports -------- -Applies to Autodesk Nastran 2015, Autodesk Nastran 2016, Autodesk Nastran 2017, Infrastructure Map Server 2014, Infrastructure Map Server 2015, Infrastructure Map Server 2016, Infrastructure Map Server 2017, Maya 2014, Maya 2015, Maya 2016, Maya 2017, Moldflow Insight 2015, Moldflow Insight 2016, Moldflow Insight 2017, MotionBuilder 2014, MotionBuilder 2015, MotionBuilder 2016, MotionBuilder 2017, Mudbox 2014, Mudbox 2015, Mudbox 2016, Mudbox 2017, Softimage 2014, Softimage 2015, Softimage 2016, VRED Design 2014, and VRED Products 2017 \ No newline at end of file +Applies to Autodesk Nastran 2015, Autodesk Nastran 2016, Autodesk Nastran 2017, Infrastructure Map Server 2014, Infrastructure Map Server 2015, Infrastructure Map Server 2016, Infrastructure Map Server 2017, Maya 2014, Maya 2015, Maya 2016, Maya 2017, Moldflow Insight 2015, Moldflow Insight 2016, Moldflow Insight 2017, MotionBuilder 2014, MotionBuilder 2015, MotionBuilder 2016, MotionBuilder 2017, Mudbox 2014, Mudbox 2015, Mudbox 2016, Mudbox 2017, Softimage 2014, Softimage 2015, Softimage 2016, VRED Design 2014, VRED Products 2017 and more. \ No newline at end of file From d364116afb665fb111fc87c8d76b9ad8cbae3271 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Wed, 18 Nov 2020 18:59:16 -0800 Subject: [PATCH 6/6] fix: updated Dockerfile to avoid common lint no change to functionality --- .dockerignore | 11 +++ .github/ISSUE_TEMPLATE/bug_report.md | 22 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 16 +++++ .github/semantic.yml | 2 + .github/workflows/test-release.yaml | 33 +++++++++ .gitignore | 1 + .releaserc | 12 ++++ CHANGELOG.md | 30 --------- CODE_OF_CONDUCT.md | 81 +++++++++++++++++++++++ CONTRIBUTING.md | 30 +++++++++ Dockerfile | 19 +++--- LICENSE | 2 +- README.md | 76 ++++++++++++--------- 13 files changed, 261 insertions(+), 74 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/semantic.yml create mode 100644 .github/workflows/test-release.yaml create mode 100644 .gitignore create mode 100644 .releaserc delete mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3632b39 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +README.md +LICENSE +CHANGELOG.md +CODE_OF_CONDUCT.md +CONTRIBUTING.md +Dockerfile +.dockerignore +.git +.github/ +.gitignore +.releaserc diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..9ce9270 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,22 @@ +--- +name: Bug Report +about: Report a bug encountered with ADLMFlexNetServer +labels: +- kind/bug +--- +**This is a Bug Report** + + +**Problem:** + + +**Proposed Solution:** + + +**Steps to Reproduce:** + + + + + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..5c8b3d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,16 @@ +--- +name: Feature Request +about: Suggest a feature or enhancement to the ADLMFlexNetServer project +labels: +- kind/feature +--- +**This is a Feature Request** + + +**What would you like to be added** + + +**Why is this needed** + +**Comments** + diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..49ba2e0 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,2 @@ +# Always validate all commits, and ignore the PR title +commitsOnly: true diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml new file mode 100644 index 0000000..b42d767 --- /dev/null +++ b/.github/workflows/test-release.yaml @@ -0,0 +1,33 @@ +name: Test and Release + +# Run the workflow when a Pull Request is opened or when changes are pushed to main +on: + pull_request: + push: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + # Fetch the latest commit + - name: Checkout + uses: actions/checkout@v2 + + # Run tests + - name: Hadolint Action + uses: brpaz/hadolint-action@v1.1.0 + + release: + # Only release on push to main + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + # Waits for test jobs for each Node.js version to complete + needs: [test] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..8185199 --- /dev/null +++ b/.releaserc @@ -0,0 +1,12 @@ +{ + "branches": [ + "main" + ], + "repositoryUrl": "git@github.com:haysclark/docker-adlmflexnetserver.git", + "tagFormat": "${version}", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github" + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index d239973..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ - -# [1.0.0](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.2...1.0.0) (2017-02-04) - -### Features -- reduced container size by ~250MB -- reorganized repo -- cleaned up Dockerfile - - -# [0.9.2](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.1...0.9.2) (2017-01-19) - -### Features -- new entrypoint.sh which makes custom service startup easier - - -## [0.9.1](https://github.com/haysclark/docker-adlmflexnetserver/compare/v0.9.0...v0.9.1) (2017-01-18) - -### Improvements -- Eliminating all default arguments to fix both the logging issues and removing all magical paths and values. Props to @hyperknot -- Updating documentation and examples to match current behavior. - -### BREAKING CHANGES -- Container no longer provides auto-magical license path, use -c [license_path] instead. -- Container no longer logs to __/var/log/flexlm/lmgrd.log__, use _docker logs_ instead. - - -# 0.9.0 (2016-10-10) - -### Initial Release -- A Docker container for running _lmgrd_. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..8126520 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,81 @@ +# Contributor Covenant Code of Conduct + +- [Our Pledge](#our-pledge) +- [Our Standards](#our-standards) +- [Our Responsibilities](#our-responsibilities) +- [Scope](#scope) +- [Enforcement](#enforcement) +- [Attribution](#attribution) + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at helpdesk@infinitedescent.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, +available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html) + +For answers to common questions about this code of conduct, see +[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..283297e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +This guide is intended for project contributors. + +**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request) + +## Code of Conduct + +Please make sure you're familiar with and follow the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). + +## Reviewing Pull Requests + +1. Ensure you have locally built and tested the Docker container. + +## Approving Pull Requests + +1. Ensure there are no common Dockerfile pitfalls by _linting_ with [hadolint](https://github.com/hadolint/hadolint). +```bash +hadolint Dockerfile +``` +1. Ensure the merge message conforms to [Conventional Commits](https://conventionalcommits.org/) spec. +1. Breaking changes? Ensure the commit message contains the text `BREAKING CHANGE:`. +1. Use "Squash and Merge". This keeps a clean history in `main`, with a full history available in Pull Requests. + +## Releasing + +1. A [GitHub Actions](https://github.com/features/actions) is triggered when any code is pushed to `main`. The action will `test` the build and all tests pass, it will then use [semantic-release](https://github.com/semantic-release/semantic-release#-semantic-release) to generate additionals files as well as `tagging` the branch with the new `version`. +1. Any code pushed or merged to the GitHub `main` branch will trigger a Docker build which is published to the `@latest` [DockerHub](https://hub.docker.com/) tag. +1. Any version `tag` pushed to GitHub will trigger a Docker build, and the container will be published to [DockerHub](https://hub.docker.com/) using the same version number. + diff --git a/Dockerfile b/Dockerfile index f7bac37..2ff2bf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM centos:centos6 -MAINTAINER hays.clark@gmail.com ######################################### ## BUILD-TIME VARIABLES ## @@ -13,22 +12,20 @@ ARG TEMP_PATH=/tmp/flexnetserver ## ENVIRONMENTAL CONFIG ## ######################################### # add the flexlm commands to $PATH -ENV PATH="${PATH}:/opt/flexnetserver/" +ENV PATH="$PATH:/opt/flexnetserver/" ######################################### ## RUN INSTALL SCRIPT ## ######################################### -ADD /files /usr/local/bin +COPY /files /usr/local/bin -RUN yum update -y && yum install -y \ - redhat-lsb-core \ - wget && \ - yum clean all +RUN yum install -y redhat-lsb-core-4.0 wget-1.12 && yum clean all -RUN mkdir -p ${TEMP_PATH} && cd ${TEMP_PATH} && \ - wget --progress=bar:force ${NLM_URL} && \ - tar -zxvf *.tar.gz && rpm -vhi *.rpm && \ - rm -rf ${TEMP_PATH} +WORKDIR $TEMP_PATH +RUN wget --progress=bar:force -- $NLM_URL +RUN tar -zxvf ./*.tar.gz +RUN rpm -vhi ./*.rpm +RUN rm -rf $TEMP_PATH # lmadmin is required for -2 -p flag support RUN groupadd -r lmadmin && \ diff --git a/LICENSE b/LICENSE index ad4dab8..19389fb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Hays Clark +Copyright (c) 2016-2020 Hays Clark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index daad1e9..82a7d16 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,89 @@ ADLMFlexNetServer ================= -[![Docker Automated build](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![](https://img.shields.io/docker/pulls/haysclark/adlmflexnetserver.svg)](https://hub.docker.com/r/haysclark/adlmflexnetserver 'DockerHub') [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() +[![Docker Automated build](https://img.shields.io/docker/automated/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/builds/) [![Docker Stars](https://img.shields.io/docker/stars/haysclark/adlmflexnetserver.svg?maxAge=2592000)](https://hub.docker.com/r/haysclark/adlmflexnetserver/) [![](https://img.shields.io/docker/pulls/haysclark/adlmflexnetserver.svg)](https://hub.docker.com/r/haysclark/adlmflexnetserver 'DockerHub') [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Code of conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg)](https://github.com/haysclark/adlmflexnetserver/blob/main/CODE_OF_CONDUCT.md) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release#-semantic-release) > Unofficial Autodesk License Manager FLEXlm® Network Server container. Usage ----- -To use this container, simply treat it as if you were calling _lmgrd_ directly. The only caveat is that the container ALWAYS adds the '-z' flag so that _lmgrd_ will run in the Foreground. Otherwise, Docker believes the task is over, and the container will 'stop' immediately. +> To use this container, simply treat it as if you were calling _lmgrd_ directly. The only caveat is that the container **ALWAYS** appends the `-z` flag when executing _lmgrd_ internally so to ensure it runs in the Foreground; otherwise, Docker believes the command has finished executing, and the container is immediately stopped. -The container does expect the user to map a local license file to within the __/var/flexlm__ directory. +A typical usage example, where a single license file, `adsk_server.lic`, is saved to a local directory. This directory's path, ``, is them mapped to the containers __/var/flexlm__ directory, and is finally referenced as if calling as _lmgrd_ directly: `-c /var/flexlm/adsk_server.lic`. - docker run -d --mac-address= \ - -h \ - -v :/var/flexlm/adsk_server.lic:ro \ - -p 2080:2080 -p 27000-27009:27000-27009 \ - haysclark/adlmflexnetserver - -c /var/flexlm/adsk_server.lic +```bash +docker run -d --mac-address= \ +-h \ +-v :/var/flexlm/adsk_server.lic:ro \ +-p 2080:2080 -p 27000-27009:27000-27009 \ +haysclark/adlmflexnetserver \ +-c /var/flexlm/adsk_server.lic +``` -Alternatively, you can map a local folder containing multiple keys to the __/var/flexlm__ directory. +Alternatively, you can map a local folder containing multiple keys to the __/var/flexlm__ directory as well. - docker run -d --mac-address= \ - -h \ - -v :/var/flexlm \ - -p 2080:2080 -p 27000-27009:27000-27009 \ - haysclark/adlmflexnetserver - -c /var/flexlm/license_file_1:/var/flexlm/license_file_2 +```bash +docker run -d --mac-address= \ +-h \ +-v :/var/flexlm \ +-p 2080:2080 -p 27000-27009:27000-27009 \ +haysclark/adlmflexnetserver \ +-c /var/flexlm/license_file_1:/var/flexlm/license_file_2 +``` ### Logging Docker's built-in logging functionality will collect the stdout/stderr generated by _lmgrd_. - docker logs +```bash +docker logs +``` -Thus it's recommended you do NOT use the '-l' flag to log to a file, doing so will cause your Docker logs to be empty. Additionally, avoid using the '-t' flag when using the 'run' command, enabling TTL support will cause extra line breaks in your Docker logs. +Thus it's recommended you do **NOT** use the `-l` flag to log to a file, doing so will cause your Docker logs to be empty. Additionally, avoid using the `-t` flag when using Docker's `run` command, enabling TTL support will cause extra line breaks in your Docker logs. Troubleshooting --------------- If you are unsure if the server is running correctly, you can log into the container. - docker exec -it /bin/bash +```bash +docker exec -it /bin/bash +``` Once in bash run: - lmutil lmstat -a -c +```bash +lmutil lmstat -a -c +``` Image Variants -------------- ### haysclark/adlmflexnetserver: -| Version | Description | -|---------|-----------------------------------------------------------------------| -| v1.0.0 | Uses NLM 11.13.1.2 (support pre-2020 products) | -| v1.0.1 | Uses NLM 11.16.2.0 (required for 2020 products / backwards compatible | +| Version | Description | +|------------|-----------------------------------------------------------------------| +| v1.0.0 | Uses NLM 11.13.1.2 (support pre-2020 products) | +| >= v1.0.1 | Uses NLM 11.16.2.0 (required for 2020 products / backwards compatible | -Building Custom Image ---------------------- -If a specific version of _nlm_ is needed, you can compile it locally. +Building a custom Docker image +------------------------------ +The base container is intended to support a wide range of cases; however, some _build arguments_ have been included to allow easy access to aspects of the build process. ### Build Arguments The following build arguments have been exposed. -| Name | Description | -|-----------|---------------------------------| -| NLM_URL | url for Network License Manager | -| TEMP_PATH | path for temporary files | +| Name | Required | Description | +|---------------------|----------|---------------------------------------| +| NLM_URL | no | URL to the NLM (Network License Manager) .gz file | +| TEMP_PATH | no | temporary file path for installation | Usage example: - docker build --build-arg NLM_URL= . +```bash +docker build --build-arg NLM_URL= . +``` Resources ---------