-
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from its-a-feature/docker_updates
Docker updates
- Loading branch information
Showing
66 changed files
with
4,350 additions
and
2,800 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#FROM itsafeaturemythic/mythic_go_base:latest | ||
FROM golang:1.21-alpine | ||
WORKDIR /usr/src/app | ||
|
||
ARG GOPROXY=proxy.golang.org | ||
ARG GO111MODULE | ||
|
||
RUN go env -w GOPROXY=${GOPROXY} | ||
RUN go env -w GO111MODULE=${GO111MODULE} | ||
|
||
COPY ["src/", "."] | ||
|
||
RUN apk add --no-cache make | ||
|
||
RUN make build_all | ||
|
||
FROM alpine | ||
|
||
COPY --from=0 /usr/src/app/mythic-cli_linux /mythic-cli_linux | ||
COPY --from=0 /usr/src/app/mythic-cli_macos /mythic-cli_macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
FROM itsafeaturemythic/mythic_go_base:latest | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ARG GOPROXY=proxy.golang.org | ||
ARG GO111MODULE | ||
|
||
RUN go env -w GOPROXY=${GOPROXY} | ||
RUN go env -w GO111MODULE=${GO111MODULE} | ||
|
||
COPY ["src/", "."] | ||
|
||
RUN go mod download | ||
RUN go mod tidy | ||
|
||
CMD ["/bin/bash", "-c", "make", "build"] | ||
FROM ghcr.io/its-a-feature/mythic_cli:v0.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
BINARY_NAME=mythic-cli | ||
LOCAL_PATH=$(shell pwd)/src | ||
LOCAL_PATH=$(shell pwd) | ||
BUILDER_IMAGE=ghcr.io/its-a-feature/mythic_cli:v0.0.3 | ||
.PHONY: default | ||
default: build_all_linux ; | ||
default: build_linux ; | ||
|
||
# pull in build and env options from global settings | ||
-include ../build.env | ||
-include ../.env | ||
|
||
export | ||
|
||
build_container: | ||
docker build -t mythic-cli --build-arg GOPROXY --build-arg GO111MODULE . | ||
|
||
build_binary: | ||
docker run --env GOPROXY --env GO111MODULE --name mythic-cli-builder --rm -v ${LOCAL_PATH}:/usr/src/app mythic-cli make build_linux | ||
mv src/${BINARY_NAME} . | ||
chmod +x ${BINARY_NAME} | ||
build_binary_linux: | ||
docker run -v ${LOCAL_PATH}/copy_file/:/copy_file/ --rm -ti ${BUILDER_IMAGE} sh -c "cp /mythic-cli_linux /copy_file/mythic-cli" | ||
mv ./copy_file/${BINARY_NAME} . && rm -rf ./copy_file && chmod +x ${BINARY_NAME} | ||
|
||
build_binary_macos: | ||
docker run --env GOPROXY --env GO111MODULE --name mythic-cli-builder --rm -v ${LOCAL_PATH}:/usr/src/app mythic-cli make build_macos | ||
mv src/${BINARY_NAME} . | ||
chmod +x ${BINARY_NAME} | ||
docker run -v ${LOCAL_PATH}/copy_file/:/copy_file/ --rm -ti ${BUILDER_IMAGE} sh -c "cp /mythic-cli_macos /copy_file/mythic-cli" | ||
mv ./copy_file/${BINARY_NAME} . && rm -rf ./copy_file && chmod +x ${BINARY_NAME} | ||
|
||
build_binary_macos_local: | ||
cd src && go build -o ../../mythic-cli . | ||
|
||
build_all_linux: build_container build_binary | ||
build_all_macos: build_container build_binary_macos | ||
build_linux: build_binary_linux | ||
build_macos: build_binary_macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package config | ||
|
||
// MythicDockerLatest is the most recent tagged version pushed to GitHub packages | ||
const MythicDockerLatest = "v0.0.3" |
Oops, something went wrong.