riftbit/goracle

By riftbit

Updated over 1 year ago

Simply run golang apps that needs oracle instant client (debian & alpine) with wkhtmltopdf

Image
2

10K+

riftbit/goracle repository overview

About

Containers for simple run golang apps that needs oracle instant client (and wkhtmltopdf). All binaries and env settings are ready to use from the box.

All containers builds every night and always up to date! :)

Docker Pulls Docker Stars

Tags

  • latest, debian, debian-oic, debian-oic-<oic-version> - are based on debian:buster-slim with Oracle Instant Client
  • debian-oic-wkhtmltopdf, debian-oic-<oic-version>-wkhtmltopdf - are based on debian:buster-slim with Oracle Instant Client and wkhtmltopdf
  • debian-wkhtmltopdf - is based on debian:buster-slim without Oracle Instant Client but with wkhtmltopdf
  • alpine, alpine-<oic-version> - are based on alpine:3.12 with glibc (2.32-r0) installed and Oracle Instant Client (!in dev, dont use in production while you see this message!)

Examples

Build Example

# STEP 1 build executable binary
FROM golang:1-buster

ENV GO111MODULE=on

# Create appuser
RUN useradd -m -s /bin/sh appuser \
    && apt-get update \
    && apt-get upgrade -y

COPY . /src/
WORKDIR /src/

RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go get -d \
    && go generate \
    && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
        go build -gcflags='-l=4' --ldflags '-w -s' -installsuffix cgo -a -o /go/bin/app

Workplace example

FROM riftbit/goracle
MAINTAINER Riftbit ErgoZ
RUN useradd -m -s /bin/sh appuser
COPY --chown=appuser ./app /my_cool_golang_oracle_application
USER appuser
ENTRYPOINT ["/my_cool_golang_oracle_application"]

Full example (with build steps)

# STEP 1 build executable binary
FROM golang:1-buster as builder

ENV GO111MODULE=on

# Create appuser
RUN env && useradd -m -s /bin/sh appuser \
    && apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y ca-certificates

COPY . /src/
WORKDIR /src/

RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go get -d \
    && go generate \
    && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
        go build -gcflags='-l=4' --ldflags '-w -s' -installsuffix cgo -a -o /go/bin/app


# STEP 2 build a small image
FROM riftbit/goracle

MAINTAINER Riftbit ErgoZ

COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

COPY --chown=appuser --from=builder /go/bin/app /my_cool_golang_oracle_application

# Copy our static executable
USER appuser

ENTRYPOINT ["/my_cool_golang_oracle_application"]

Tag summary

Content type

Image

Digest

sha256:9c0663eef

Size

78.4 MB

Last updated

over 1 year ago

docker pull riftbit/goracle:debian-oic-21.1.0.0.0