# build image
FROM alpine:edge AS builder
COPY . /usr/fc-backend
WORKDIR /usr/fc-backend
ENV GOOS=linux
ENV GOARCH=amd64
# timezone setting & install go
RUN apk add --update go \
&& go build -v -o backend.exe main.go \
&& chmod +x backend.exe
# deploy image
FROM ubuntu:18.04
COPY --from=builder /usr/fc-backend/backend.exe /
WORKDIR /
USER root
ENV DEBCONF_NOWARNINGS yes
# timezone setting & install go
RUN ln -sSf /usr/share/zoneinfo/Asia/Seoul /etc/localtime \
&& apt-get -y update \
&& apt-get -y upgrade \
&& dpkg --add-architecture i386 \
&& apt-get install -y wget gnupg golang-go software-properties-common \
&& wget -nc https://dl.winehq.org/wine-builds/winehq.key \
&& apt-key add winehq.key \
&& add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' \
&& apt-get -y update \
&& apt-get install --install-recommends -y wine-staging-i386 wine-staging-amd64 wine-staging winehq-staging
EXPOSE 8096
ENTRYPOINT ["wine", "backend.exe"]
# ENTRYPOINT ["go", "run", "main.go"]
3시간의 고전 끝에 빌드까지 문제 없이 실행시켰으나
원점으로 돌아간 문제가 발생한다...
wine: created the configuration directory '/root/.wine'
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.0-rc2 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
0048:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0050:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0048:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
0048:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0048:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0048:err:systray:initialize_systray Could not create tray window
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0040:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0040:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0050:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0050:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 3
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x800736b7
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x800736b7
0050:err:ole:apartment_get_local_server_stream Failed: 0x800736b7
0050:err:ole:start_rpcss Failed to open RpcSs service
002c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
002c:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0074:err:winedevice:ServiceMain Failed to load L"C:\\windows\\system32\\win32k.sys"
0074:err:winedevice:ServiceMain Failed to load L"C:\\windows\\system32\\drivers\\dxgkrnl.sys"
0074:err:winedevice:ServiceMain Failed to load L"C:\\windows\\system32\\drivers\\dxgmms1.sys"
0084:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0084:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
008c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
008c:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
00a4:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00a4:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
wine: configuration in L"/root/.wine" has been updated.
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.
결론
wine을 사용해서 굳이 exe파일을 실행시키기 위해 이미지를 무겁게 만들지말고
편하게 go run 하자
'Container > Docker' 카테고리의 다른 글
failed to solve with frontend dockerfile.v0 failed to read dockerfile (0) | 2022.07.20 |
---|---|
WSL 2.0 환경에서 Docker 설치 (0) | 2022.03.19 |
required by: world[package] 오류 해결법 (0) | 2021.12.15 |
spring 멀티스테이지 빌드 Docker 이미지 (0) | 2021.11.24 |
nodejs 멀티스테이지 빌드 Docker 이미지 (0) | 2021.11.23 |