Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOOS profiles tech debt cleanup #376

Closed
jakedoublev opened this issue Sep 10, 2024 · 1 comment · Fixed by #378
Closed

GOOS profiles tech debt cleanup #376

jakedoublev opened this issue Sep 10, 2024 · 1 comment · Fixed by #378
Assignees

Comments

@jakedoublev
Copy link
Contributor

jakedoublev commented Sep 10, 2024

All of the following are tested:

built on runtime GOOS profiles visible client creds / host (no profile) works
darwin darwin [ ]
darwin linux [ ]
linux linux [ ]
linux darwin [ ]
@jakedoublev
Copy link
Contributor Author

jakedoublev commented Sep 11, 2024

Testing with a Dockerfile that builds each in Linux:

FROM golang:1.22-bullseye AS builder

WORKDIR /app

COPY . .

RUN go mod download

RUN mkdir -p output

RUN CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o otdfctl-macos .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o otdfctl-linux .

# Mount volume for output
VOLUME /output

RUN cp otdfctl-linux ./output/otdfctl-linux
RUN cp otdfctl-macos ./output/otdfctl-macos

ENTRYPOINT ["/bin/bash"]

Exec into the container to inspect/manipulate binaries:
docker run -ti --rm -v $(pwd)/output:/output go-cross-compile

Run the binary in Linux on MacOS:
docker run --network host --rm -v $(pwd):/app -w /app ubuntu bash -c "./otdfctl "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant