https://github.com/ancientlore/goimg
Small image to use when CGO is disabled
https://github.com/ancientlore/goimg
Last synced: about 1 year ago
JSON representation
Small image to use when CGO is disabled
- Host: GitHub
- URL: https://github.com/ancientlore/goimg
- Owner: ancientlore
- Created: 2021-04-09T20:21:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-13T03:47:35.000Z (over 1 year ago)
- Last Synced: 2025-02-13T04:28:02.770Z (over 1 year ago)
- Language: Go
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goimg
Small Go image to use when CGO isn't needed.
* Runs as a non-root user by default.
* CA certificates are pulled from the [Common CA Database](https://www.ccadb.org/).
* Time Zone database is pulled from the Go image (`zoneinfo.zip`).
* Less than 1MB.
* Home and temp directories are available.
* You must use `CGO_ENABLED=0` to build, because no OS libraries are present.
## Use the Image
The image is tagged with the major Go version because that indicates which `zoneinfo.zip` is included.
docker pull ancientlore/goimg:1.20
Presumably you would put your Go binary into `/usr/bin` or `/bin`. A sample Dockerfile might be:
FROM golang:1.20 as builder
COPY . /go/test
WORKDIR /go/test
RUN CGO_ENABLED=0 go build -o /go/bin/test
FROM ancientlore/goimg:1.20
COPY --from=builder /go/bin/test /usr/bin/test
CMD [ "/usr/bin/test"]
## Groups
| ID | Name |
|-------|---------|
| 0 | root |
| 65532 | nonroot |
## Users
| ID | Name | Default |
|-------|---------|---------|
| 0 | root | No |
| 65532 | nonroot | Yes |
## File System
| Mode | Group | User | Size | Path |
|--------------|-------|-------|--------|-----------------------------------|
| `drwxr-xr-x` | 0 | 0 | 0 | bin/ |
| `drwxr-xr-x` | 0 | 0 | 0 | etc/ |
| `-rw-r--r--` | 0 | 0 | 27 | etc/group |
| `-rw-r--r--` | 0 | 0 | 91 | etc/passwd |
| `drwxr-xr-x` | 0 | 0 | 0 | etc/ssl/ |
| `drwxr-xr-x` | 0 | 0 | 0 | etc/ssl/certs/ |
| `-rw-r--r--` | 0 | 0 | 227161 | etc/ssl/certs/ca-certificates.crt |
| `-rw-r--r--` | 0 | 0 | 425884 | etc/zoneinfo.zip |
| `drwx------` | 65532 | 65532 | 0 | home/ |
| `drwx------` | 0 | 0 | 0 | root/ |
| `drwxrwxrwt` | 0 | 0 | 0 | tmp/ |
| `drwxr-xr-x` | 0 | 0 | 0 | usr/ |
| `drwxr-xr-x` | 0 | 0 | 0 | usr/bin/ |
## Environment
| Key | Value |
|----------|-------------------|
| PATH | /usr/bin:/bin |
| ZONEINFO | /etc/zoneinfo.zip |
| HOME | /home |