After numerous attempts, I was finally able to successfully run the newer SP-7 image on an amd64 system. The issue stemmed from a missing shebang line (#!/bin/bash) at the beginning of the entrypoint script (/opt/specify7/docker-entrypoint.sh) in the latest SP-7 image.
To resolve this, I built a custom image based on specifyconsortium/specify7-service:v7, ensuring the correct shebang was present at the top of the entrypoint script. This resolved the issue and allowed the container to start properly.
Hereâs the relevant snippet from my Dockerfile:
FROM specifyconsortium/specify7-service:v7
# Ensure you are root for fixing entrypoint
USER root
# Fix entrypoint
RUN head -n 1 /opt/specify7/docker-entrypoint.sh | grep -q '^#!.*bash' || \
sed -i '1i #!/bin/bash' /opt/specify7/docker-entrypoint.sh && \
chmod +x /opt/specify7/docker-entrypoint.sh
USER specify
Would it be possible to include the #!/bin/bash line in future official builds of the SP-7 image for the amd64 architecture to avoid the need for custom rebuilding?
Also, while SP-7 now runs correctly on my server, Iâve noticed that the âAboutâ window still doesnât display the Specify 7 version information. Am I perhaps missing a configuration step?
Yup, the missing shebang should be added back in 7.10.3, has been merged
The missing version should be in >= 7.10, was a bug in 7.9. But it looks like you have v7, so it should be pulling 7.10. Can you check the git SHA, no further configuration should be necessary for it to return. Your build date is 2 weeks ago, whereas 7.10.0 was last pushed 15 days according to dockerhub (although I donât know how to see the first date the image was pushed, in theory it would just be pushed once upon initial release)
Hi @markp,
Thanks! Great to hear that the missing shebang will be included again in version 7.10.3.
Quick questionâwhen I click on the âgit SHAâ in the About window, it just takes me to the general link: https://github.com/specify/specify7/commit/
Is it supposed to point to a specific commit instead?
The bug for the version doesnât mention that the SHA should also be missing (it is present in the screenshots showing the missing version) EDIT: The SHA missing is also part of the bug as seen in the title of the PR that fixes it
If you run docker images that should also show you the tag of the images I believe.
As a temporary workaround for the shebang issue, Iâve rebuilt the image using the Consortiumâs v7 tagged base image. However, I noticed that this tag doesnât explicitly indicate which version of SP-7 it includes.
Hereâs the base image I used:
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/specifyconsortium/specify7-service v7 7cbfd8cb7f02 2 weeks ago 322 MB
And hereâs my rebuilt version:
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/cfservice/specify7-service-ssl v7 4e486aae2b18 About an hour ago 328 MB
I should have foreseen that the tag would display as v7 with that command. Dockerhub lists that as also being built 15 days ago, so assuming you have rebuilt, I donât have any remaining inferences on why you would not be on 7.10.1, and therefore not have the version bug fixed. I can try on my local dev copy to see if I can pull with v7 successfully.
docker compose pull
docker compose up --force-recreate --build -d
FYI @markp & @Grant
I replaced my v7 image with the v7.10.0 & v7.10.1 images (including the temporary shebang fix), but Iâm still seeing the same issueâthe version number and Git SHA are missing from the About window.
I pushed a new image to specifyconsortium/specify7-service:v7 that should fix the git_sha and builder_version issue.
It seems there is an issue with the shebang in the docker-entrypoint.sh file between the arm64 and amd64 images. It seems using #!/usr/bin/env sh is a more universal shebang than #!/bin/bash. Weâll update that in production, but if the shebang is still an issue for your instance, try using this more universal shebang.
I used your updated specifyconsortium/specify7-service:v7 image and rebuilt my custom image, modifying the Dockerfile to include your suggested shebang (#!/usr/bin/env sh).
Hereâs the relevant section of the Dockerfile:
FROM specifyconsortium/specify7-service:v7
# Ensure you are root for package installs and cert updates as well as when fixing entrypoint
USER root
# Fix entrypoint â this ensures the script uses a portable, shell-agnostic shebang.
# It adds '#!/usr/bin/env sh' if missing, and replaces any existing shebang.
RUN grep -q '^#!' /opt/specify7/docker-entrypoint.sh || \
sed -i '1i #!/usr/bin/env sh' /opt/specify7/docker-entrypoint.sh && \
sed -i '1s|^#!.*|#!/usr/bin/env sh|' /opt/specify7/docker-entrypoint.sh && \
chmod +x /opt/specify7/docker-entrypoint.sh
# Switch back to the default user
USER specify
The Specify7 version now correctly shows as v7.10.2 in the About window â great progress!
However, I noticed that the Git SHA still links generically to https://github.com/specify/specify7/commit/ without referencing a specific commit.
This is strange⊠I also noticed that the âBuild Dateâ displayed in the About window indicates â2 weeks agoâ. Shouldnât it indicate yesterday?
@Heryk Maybe check your docker-compose.yml file. In the specify7 section of the file, if you are adding image: specifyconsortium/specify7-service:v7 instead of building locally, then you will need to comment out this line - "./specifyweb:/opt/specify7/specifyweb" to avoid overwriting. If you are using one of the docker-compose.yml file from the docker-compositions GitHub repo, then there shouldnât be a problem. This issue would only happening if you are editing the default docker-compose.yml file the specify7 GitHub repo.
I just double checked by pulling the v7 image again, and it seemed to work. Iâll try to think of another possibility as to why it wouldnât work for you.
Maybe try building locally if itâs still not working.
For security compliance, weâre required to use Podman instead of Docker, which is why Iâve been manually starting all containers for the past year rather than using Docker Compose.
The reason Iâm building a new local image on top of the v7 base image is to ensure compatibility with my amd64 architecture. Specifically, I needed to add a proper shebang (#!/usr/bin/env sh) to the docker-entrypoint.sh file â without this change, the application fails to run in my environment. BTW, Iâm also adding my root certificats to my new image.
Here are the two Podman commands Iâm using to start the Specify service and worker:
Itâs odd that the sp7 version and build date seem to be working for you, but not the Git SHA. The git_sha and build_version are both build parameters for building the Specify7 image, which are then added to there own files for the front-end to fetch when needed. So, theoretically they should either both work, or neither should work.
Test the state of the relevant files with the following commands:
Another test would be to try writing to the git_sha.txt file directly and seeing if itâs getting found by the front-end. Try running this command and then refreshing the webpage:
When you create a build that is uses v7 as the base image, maybe try adding the build arguments to the command, that might fix the issue (depending on podmanfile/dockerfile).
Since your basing your podman commands off of the docker-compositions repo all-in-one docker-compose.yml file, you should be good. The case I mentioned about possibly needed to comment out a line was just for the Specify7 repo docker-compose.yml file. The volumes on your run command look good.
If itâs not working, maybe also try running podman pull specifyconsortium/specify7-service:v7 one more time to ensure the latest version.
Let me know what value is in the specifyweb/frontend/static/git_sha.txt in your Specify 7 container (or if the file exists).
And then I checked the âAboutâ window aging and it was displaying the correct information now! The Git SHA and Build Date are displaying the correct information!